Grok Imagine Image 2.0 API
xAI's Grok Imagine Image 2.0 generates and edits images with precise controls, ranking #2 on Arena leaderboards and scoring 75/100 on ImageBench V1.
Grok Imagine Image 2.0 is xAI's next-generation image generation and editing model, released on August 7, 2026. It accepts text, image, and PDF input and produces images, offering a 65,536-token context window and an output limit of 58,982 tokens. The model can generate 1 to 10 images per request at 1K and 2K resolutions, with low and medium quality modes and aspect ratios including 1:1, 16:9, 9:16, 3:4, 3:2, and 2:3.
For editing, Grok Imagine Image 2.0 provides a magic wand, segmentation, background removal, and smart resize tools. It supports multi-reference editing with up to 5 reference images and can target specific regions within an image for localized edits. The model maintains consistency across repeated edits and generations, and it follows complex multi-element prompts with layout-aware generation. It is integrated into the Grok app as a quality mode and linked with X.
Grok Imagine Image 2.0 suits professional design workflows that need precise editing and layout control, marketing asset production with brand consistency across variations, and product mockups or advertising creatives using background removal and smart resize. It also supports iterative content creation with repeated small revisions, confidential and commercial creative projects, and game asset or concept art creation. Limitations include a maximum resolution of 2K, no self-hosting or fine-tuning, and some user reviews noting that GPT Image better preserves non-standard character stylization and has less censorship.
Updated:
MODEL ID
grok-imagine-image-2.0- Input
- text / image
- Output
- image
Highlights
- Precise magic wand and segmentation editing
- Multi-reference editing with up to 5 images
- Generates 1 to 10 images per request
- Supports 1K and 2K resolutions
- Consistent results across repeated edits
- Integrated into the Grok app as a quality mode
Providers
Best priceCompare API prices across providers. Select a provider to view all charges and conditions.
| Uptime | ||
|---|---|---|
| $0.08 | ||
Historical observations are not a live health check. Missing data does not mean an outage.
Benchmarks
- #2
Arena image generation leaderboard
world ranking
- #2
Arena image editing leaderboard
world ranking
- 75
ImageBench V1 overall
out of 100
- 100
ImageBench V1 text rendering
out of 100
- 55
ImageBench V1 human realism
out of 100
Scores as published by the model provider.
Quick Start
Submit an image task, poll its status, then save the images. These examples use curl and Python 3 (standard library only).
POST https://openapi.felo.ai/api/v1/images/generations
1Get your API key
Create a key from your Felo API Platform account and set it as an environment variable.
export FELO_API_KEY="YOUR_API_KEY"2Make your first request
Optional values vary by model. This example leaves them unset; confirm supported values in Playground before adding them. Request fields sit alongside model and prompt, without an input wrapper.
curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-o created.json \
-d '{
"prompt": "A studio product photo of a ceramic coffee cup on warm linen, soft morning light",
"model": "grok-imagine-image-2.0"
}'3Poll the task
Submission returns task_id. Poll every 3 seconds while queued or running; stop on succeeded, failed or interrupted. This example stops waiting after 30 minutes. Keep created.json to resume querying the same task instead of submitting again.
python3 - <<'PY'
import json, os, time
from pathlib import Path
from urllib.parse import quote
from urllib.request import Request, urlopen
task = json.loads(Path("created.json").read_text())
task_id = task["task_id"]
url = "https://openapi.felo.ai/api/v1/images/generations/" + quote(task_id, safe="")
headers = {"Authorization": "Bearer " + os.environ["FELO_API_KEY"]}
deadline = time.monotonic() + 1800
while task["status"] in ("queued", "running"):
if time.monotonic() >= deadline:
raise TimeoutError(f"Keep task_id={task_id} to resume polling")
time.sleep(3)
with urlopen(Request(url, headers=headers), timeout=60) as response:
task = json.load(response)
if task.get("task_id") != task_id or task.get("kind") != "image":
raise ValueError("Unexpected task response")
print(task["status"])
if task["status"] != "succeeded":
raise RuntimeError(task.get("error") or task["status"])
if not task.get("outputs"):
raise ValueError("Task succeeded without image outputs")
Path("task.json").write_text(json.dumps(task))
print("Saved task.json")
PY4Download the output
After success, save outputs from task.json. Results may be HTTPS URLs, URL objects or b64_json. Download signed URLs promptly; media downloads do not use your API key.
python3 - <<'PY'
import base64, json
from pathlib import Path
from urllib.request import urlopen
task = json.loads(Path("task.json").read_text())
if task.get("status") != "succeeded" or not task.get("outputs"):
raise ValueError("No completed image outputs")
extensions = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp", "image/gif": ".gif", "image/avif": ".avif"}
for index, output in enumerate(task["outputs"], 1):
item = output if isinstance(output, dict) else {}
url = output if isinstance(output, str) else item.get("url") or item.get("unsigned_url")
mime = item.get("media_type") or "image/png"
if url and url.startswith("https://"):
with urlopen(url, timeout=60) as response:
data = response.read()
mime = response.headers.get_content_type()
elif url and url.startswith("data:image/") and ";base64," in url:
header, encoded = url.split(",", 1)
mime = header[5:].split(";", 1)[0]
data = base64.b64decode(encoded, validate=True)
elif item.get("b64_json"):
data = base64.b64decode(item["b64_json"], validate=True)
else:
raise ValueError("Unrecognized image output")
path = Path(f"image-{index}" + extensions.get(mime, ".bin"))
path.write_bytes(data)
print(path)
PYinput_references
For image editing, replace the example URL with your HTTPS image URL or a base64 image data URL. Submit once, then use the same polling and saving steps.
curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-o created.json \
-d '{
"prompt": "Keep the product and framing. Replace the background with a sunlit marble countertop.",
"model": "grok-imagine-image-2.0",
"input_references": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/product.png"
}
}
]
}'Supported parameters
- n
- quality
- resolution
- aspect_ratio
- input_references
Prefer the full reference?
API reference →Frequently asked questions
What is Grok Imagine Image 2.0?
Grok Imagine Image 2.0 is xAI's next-generation image generation and editing model, released on August 7, 2026. It accepts text, image, and PDF input and produces images, offering a 65,536-token context window and an output limit of 58,982 tokens. The model can generate 1 to 10 images per request at 1K and 2K resolutions, with low and medium quality modes and aspect ratios including 1:1, 16:9, 9:16, 3:4, 3:2, and 2:3. For editing, Grok Imagine Image 2.0 provides a magic wand, segmentation, background removal, and smart resize tools. It supports multi-reference editing with up to 5 reference images and can target specific regions within an image for localized edits. The model maintains consistency across repeated edits and generations, and it follows complex multi-element prompts with layout-aware generation. It is integrated into the Grok app as a quality mode and linked with X. Grok Imagine Image 2.0 suits professional design workflows that need precise editing and layout control, marketing asset production with brand consistency across variations, and product mockups or advertising creatives using background removal and smart resize. It also supports iterative content creation with repeated small revisions, confidential and commercial creative projects, and game asset or concept art creation. Limitations include a maximum resolution of 2K, no self-hosting or fine-tuning, and some user reviews noting that GPT Image better preserves non-standard character stylization and has less censorship.
How is usage billed?
Your bill depends on the provider you use, its prices and your usage. Longer inputs or other conditions may have different prices.
What input modalities does Grok Imagine Image 2.0 support?
It accepts text, image, and PDF input and produces image output.
What are the context and output limits?
The model has a 65,536-token context window and an output limit of 58,982 tokens.
How many images can it generate per request?
It generates 1 to 10 images per request, with support for 1K and 2K resolutions.
What editing tools does it offer?
It includes a magic wand, segmentation, background removal, and smart resize tools, and supports multi-reference editing with up to 5 reference images.
What tasks is Grok Imagine Image 2.0 best suited for?
It is suited for professional design workflows, marketing asset production, product mockups and advertising creatives, iterative content creation, confidential and commercial projects, and game asset creation.
How does it compare to other models in the series?
It is the next-generation model in the Grok Imagine Image series, alongside Grok Imagine Image and Grok Imagine Image 2.