# Grok Imagine Image Edit (`grok_imagine_image/edit`)

> xAI Grok image editing. Cheapest image editing model.

- Capability: Images (tool `image`) — Image to image
- Price: from $0.03 per run (1 credit = $0.01). Exact price for a request: POST https://api.varg.ai/v2/estimate
- Typical time: ~15 s
- JSON Schema: https://api.varg.ai/v2/tools/image?model=grok_imagine_image%2Fedit (public, no key)
- Try it: https://varg.ai/dashboard/tools/playground?model=grok_imagine_image%2Fedit

## Call it

REST: `POST https://api.varg.ai/v2/tools/image/call` with `Authorization: Bearer $VARG_API_KEY` (create a key at https://varg.ai/dashboard/api).
It answers `202` with a job right away. Poll `GET /v2/jobs/{id}` until `status` is `completed`, then read `output.outputs[0].url` — or pass `options.webhook_url` and get the finished job POSTed to you.

```bash
curl -X POST https://api.varg.ai/v2/tools/image/call \
  -H "Authorization: Bearer $VARG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok_imagine_image/edit",
  "prompt": "Add a beautiful young woman with long dark brown hair, wearing white silk pajamas, standing barefoot beside the bed, looking at it curiously, about to lie down. She is naturally lit, properly scaled to the room. Keep the bedroom and bed exactly as they are.",
  "files": [
    {
      "url": "https://s3.varg.ai/u/194b94d0-58ff-4e8b-91de-4f1959d04013/3e509b2e8829fa121a0cb889a396db1f78b7ec607455daa12a8f28f8ff0979d4.jpg"
    },
    {
      "url": "https://v3b.fal.media/files/b/0a92b1c7/hP5qHwwuADHwxLqY3ZKuW_Be5mSNEU.png"
    }
  ]
}'
```

MCP: the varg server `https://mcp.varg.ai/mcp` (OAuth sign-in, no key) runs it with `call_tool`:

```json
{
  "tool": "image",
  "input": {
    "model": "grok_imagine_image/edit",
    "prompt": "Add a beautiful young woman with long dark brown hair, wearing white silk pajamas, standing barefoot beside the bed, looking at it curiously, about to lie down. She is naturally lit, properly scaled to the room. Keep the bedroom and bed exactly as they are.",
    "files": [
      {
        "url": "https://s3.varg.ai/u/194b94d0-58ff-4e8b-91de-4f1959d04013/3e509b2e8829fa121a0cb889a396db1f78b7ec607455daa12a8f28f8ff0979d4.jpg"
      },
      {
        "url": "https://v3b.fal.media/files/b/0a92b1c7/hP5qHwwuADHwxLqY3ZKuW_Be5mSNEU.png"
      }
    ]
  },
  "wait": true
}
```

## Inputs

| field | type | required | default | allowed | description |
|---|---|---|---|---|---|
| `model` | string | yes | — | `grok_imagine_image/edit` or a route key below | Which model runs the job. |
| `prompt` | string | no | — | — | — |
| `files` | array of { url } | no | — | — | — |
| `aspect_ratio` | string | no | — | e.g. 16:9 \| 9:16 \| 1:1 \| 4:3 \| 3:4 \| 21:9 \| auto | — |

Media inputs are URLs. Upload a local file first with `POST /v2/files` and pass the returned URL.

## Provider options

Optional, per provider, under `provider_options.<provider>`. Only the options of the provider that runs the job apply — pin a route to choose it.

### provider_options.fal

| field | type | required | default | allowed | description |
|---|---|---|---|---|---|
| `prompt` | string | no | — | — | Text description of the desired image. |
| `image_urls` | array of URL strings | no | — | — | — |
| `sync_mode` | boolean | no | — | — | If `True`, the media will be returned as a data URI and the output data won't be available in the request history. |
| `num_images` | integer | no | — | 1–4 | Number of images to generate. |
| `resolution` | string | no | — | 1k \| 2k | — |
| `aspect_ratio` | string | no | — | auto \| 2:1 \| 20:9 \| 19.5:9 \| 16:9 \| 4:3 \| 3:2 \| 1:1 \| 2:3 \| 3:4 \| 9:16 \| 9:19.5 \| 9:20 \| 1:2 | — |
| `output_format` | string | no | — | jpeg \| png \| webp | — |

## Routes

`"model": "grok_imagine_image/edit"` picks a route automatically (priority order, then the inputs you send). To pin one, pass its key as `model`.

| model key | provider | modality | price from | typical time |
|---|---|---|---|---|
| `fal:grok_imagine_image/edit` | fal | image-to-image | $0.03 | ~15 s |

## Example output

- image/jpeg: https://s3.varg.ai/o/job_33279b23.jpg

---

Catalog version 2026-11-11T12:59:09.901887+00:00. All models: https://varg.ai/models/llms.txt
