Text to image
Elo · text-to-image arena
Custom pricing for production workloads
The second generation of xAI's image model for generation and editing, with close instruction following, sharp small text and edits from up to 5 reference images.
Send a prompt, and optionally up to 5 reference images, to the image endpoints and receive generated or edited images.
x-ai/grok-imagine-image-2.0POST https://api.aimlapi.com/v1/images/generationsGrok Imagine Image 2.0 is the second generation of xAI's image model, covering both image generation and image editing. It follows detailed instructions closely, renders small text and typography sharply, and edits from up to 5 reference images. It is available on AI/ML API as x-ai/grok-imagine-image-2.0 through the image generation and image editing endpoints.
It succeeds Grok Imagine Image and Grok Imagine Image Pro, released in March 2026. Instead of separate standard and Pro models, the second generation exposes two quality settings and three output resolutions on one model.
low or medium (medium renders more detail)POST /v1/images/generations, POST /v1/images/editsImages that contain text: posters, packaging, social media graphics, slides and UI mockups, where small type has to stay legible.
Edits that combine several sources, using up to 5 reference images to keep a product, character or style consistent in a new scene.
Detailed prompts with many constraints on composition, objects and style, where close instruction following reduces the number of retries.
Cost-controlled batches: low quality at 1K for drafts and exploration, medium quality at 2K for the final asset.
Human-preference results for Grok Imagine Image 2.0 in text to image, next to models available on AI/ML API. Data retrieved Nov 3, 2026.
Elo · text-to-image arena
USD per generation
Arena results for models you can call with the same API key.
Blind pairwise human votes on images generated from text prompts. Grok Imagine Image 2.0 ranks #5 of 98.
| Usage | Price | Unit |
|---|---|---|
| Image generation | $0.04 | per generation |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
AI/ML API rates for 5 models, per generation.
| Model | Per generation |
|---|---|
| $0.04 | |
| $0.02 | |
| $0.04 | |
| $0.04 | |
| $0.05 |
Give your agent the model details, code and documentation.
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"curl 'https://api.aimlapi.com/v1/images/generations' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "x-ai/grok-imagine-image-2.0",
"prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo."
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "x-ai/grok-imagine-image-2.0",
"prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo."
}
response = requests.post("https://api.aimlapi.com/v1/images/generations", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/images/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "x-ai/grok-imagine-image-2.0",
"prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo."
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Yes. Grok Imagine Image 2.0 is live on AI/ML API as x-ai/grok-imagine-image-2.0, on POST /v1/images/generations for generation and POST /v1/images/edits for editing.
Up to 5 reference images per editing request.
Quality low or medium, at 1k, 1.5k or 2k resolution, with aspect ratios from 1:1 to 21:9 or auto.
Grok Imagine Image 2.0 is the next generation of xAI's image model. It replaces the split between Grok Imagine Image and Image Pro with quality and resolution settings on one model, and is described as following instructions more closely and rendering small text more sharply.
Grok Imagine Image 2.0 costs $0.04 per generation on AI/ML API, billed as you go with no subscription.
Use x-ai/grok-imagine-image-2.0 as the model parameter. Requests go to https://api.aimlapi.com/v1/images/generations with your AI/ML API key.