Grok Imagine Image 2.0 Image Edit API
Image Edit with Grok Imagine Image 2.0 by xAI. xAI's top-ranked image model — photoreal, bold, fast.
per image · 1K · low
With Max: from $0.031/img →Operational99.98% uptime (30 days)Try Grok Imagine Image 2.0 Image Edit
1–3 images to edit or combine. Refer to them as "image 1", "image 2"… in the prompt.
Output image shape.
1K ≈ 1 MP, 2K ≈ 4 MP.
Create a free account with Google or email — pay only for what you generate.
Your image will appear here
Write a prompt, pick your settings and hit Run. You only pay for successful generations.
Also available: Grok Imagine Image 2.0 Text to Image
See the Grok Imagine Image 2.0 examples and prompts
Grok Imagine Image 2.0 Image Edit API
/api/v1/run/xai/grok-imagine-image/editSubmits an asynchronous job and returns 202 with a generation id. Poll GET /api/v1/generations/{id} or pass webhook_url. See job lifecycle.
Input parameters
| Name | Type | Description | Affects price |
|---|---|---|---|
promptrequired | string | Describe the shot: subject, action, camera movement, lighting and style. | No |
image_urlsrequired | string[] (URLs) | 1–3 images to edit or combine. Refer to them as "image 1", "image 2"… in the prompt. Max items: 3 | No |
aspect_ratio | string (enum) | Output image shape. Values: 1:1 · 3:4 · 4:3 · 9:16 · 16:9 · 2:3 · 3:2 · 1:2 · 2:1 · 9:19.5 · 19.5:9 · 9:20 · 20:9 Default: 1:1 | Yes |
resolution | string (enum) | 1K ≈ 1 MP, 2K ≈ 4 MP. Values: 1K · 2K Default: 1K | Yes |
webhook_url | string (URL) | Optional. We POST the finished generation here, signed with your webhook secret. Webhooks | No |
Request
const API = "https://cheapergen.com/api/v1";
const headers = {
Authorization: `Bearer ${process.env.CHEAPERGEN_API_KEY}`,
"Content-Type": "application/json",
};
// 1. Submit the job
let job = await fetch(`${API}/run/xai/grok-imagine-image/edit`, {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "Put the person from image 1 in the jacket from image 2 on a rainy Tokyo street at night",
"image_urls": [
"https://cdn.cheapergen.com/samples/portrait.jpg"
],
"aspect_ratio": "1:1",
"resolution": "1K"
}),
}).then((r) => r.json());
// 2. Poll until it finishes (or pass webhook_url and skip polling)
while (job.status === "queued" || job.status === "running") {
await new Promise((r) => setTimeout(r, 3000));
job = await fetch(`${API}/generations/${job.id}`, { headers }).then((r) => r.json());
}
console.log(job.status === "succeeded" ? job.output.images[0].url : job.error);Response
{
"id": "gen_8c2QmX1nq0k4",
"object": "generation",
"model": "xai/grok-imagine-image",
"endpoint": "xai/grok-imagine-image/edit",
"mode": "edit",
"status": "queued",
"input": {
"prompt": "Put the person from image 1 in the jacket from image 2 on a rainy Tokyo street at night",
"image_urls": [
"https://cdn.cheapergen.com/samples/portrait.jpg"
],
"aspect_ratio": "1:1",
"resolution": "1K"
},
"output": null,
"error": null,
"cost": {
"amount_usd": 0.2255,
"currency": "usd",
"estimated": true,
"official_usd": null,
"list_price_source": "official",
"list_price_label": "Official",
"saved_usd": null
},
"source": "api",
"started_at": null,
"completed_at": null,
"urls": {
"get": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4",
"cancel": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4/cancel"
},
"created_at": "2026-10-15T09:21:04Z"
}Grok Imagine Image 2.0 pricing
Pay per image as you go, with no subscription required. Failed generations are refunded automatically.
| Tier | Official price | CheaperGen | You save |
|---|---|---|---|
1K · low | $0.0329/img With a monthly plan: Pro $0.0318Max $0.0307 | −18% | |
1K · medium | $0.0429/img With a monthly plan: Pro $0.0408Max $0.0387 | −29% | |
2K · low | $0.0552/img | −8% | |
2K · medium | $0.0736/img | −8% |
Monthly plans lower prices on most models (shown under each price); you can still pay as you go. Pro $499/month · Max $4,999/month.
- Official price: xAI API list price for grok-imagine-image-2.0 (1K $0.04 low / $0.06 medium, 2K $0.06 / $0.08; $0.01 per input image). Prices verified October 18, 2026.
- Edits are billed at medium quality plus $0.01 per input image (before our discount).
More from xAI
Popular xAI models, on the same API key.

Grok ImagineVideo 1.5
Text · Reference → Video
xAI's video model — native audio, up to 1080p and 15 s
Grok ImagineVideo 1.5 Lite
Text · Image → Video
The lowest-cost Grok video — native audio from cents a second
Similar image models
Popular text-to-image models from other developers.

Seedream5.0 Pro
Text → Image · Image Edit
Production-grade image generation and precise editing

FLUX 3Image Klein
Text → Image · Image Edit
The open-weights FLUX 3 — 16-step images in seconds, from a fraction of a cent

GPT Image2.5
Text → Image · Image Edit
OpenAI's top image model — precise edits, perfect text, up to 4K

Seedream5.0 Lite
Text → Image · Image Edit
High-quality Seedream images at a lower price
