Image
Grok Imagine Image
Asynchronous text-to-image and multi-image editing with Grok Imagine Image (`grok-imagine-image`) on SeedRouter at a flat per-image rate across 1K and 2K.
grok-imagine-image generates and edits images through SeedRouter's unified asynchronous image endpoint (POST /v1/images/generations) and task polling endpoint (GET /v1/tasks/{task_id}). Every delivered image is billed at one flat per-image rate regardless of whether you pick 1k or 2k or attach reference images.
Model positioning:
grok-imagine-imageis xAI's standard flat-rate image generation and editing model across1kand2kresolutions with no extra reference-image surcharge. If you need explicitquality(lowvsmedium) or1.5kresolution, seegrok-imagine-image-2.0.
Quick reference
| Property | Value |
|---|---|
| Model ID | grok-imagine-image |
| Submit endpoint | POST https://api.seedrouter.ai/v1/images/generations |
| Poll endpoint | GET https://api.seedrouter.ai/v1/tasks/{task_id} |
| Auth | Authorization: Bearer $SEEDROUTER_API_KEY |
| Outputs per request | n: 1–10 (default 1) |
| Resolutions | 1k (default), 2k |
| Aspect ratios | auto (default) + 15 explicit ratios |
| Reference images | Optional image_urls: 1–5 public HTTP(S) URLs (JPEG, PNG, or WebP, ≤ 20 MiB each) |
| Pricing & OpenAPI | Live rates at /models/grok-imagine-image · OpenAPI /docs/grok-imagine-image.openapi.json |
Request parameters
All requests—both text-to-image generation and image editing—go to POST /v1/images/generations. Unknown parameters (including quality and response_format) are rejected with HTTP 400.
| Field | Type | Required | Default | Rules |
|---|---|---|---|---|
model | string | Yes | — | Must be "grok-imagine-image". |
prompt | string | Yes | — | 1–10,000 Unicode characters after trimming. For multi-image edits, reference inputs as <IMAGE_0>, <IMAGE_1>, etc. |
n | integer | No | 1 | 1–10. Final billing settles on delivered images. |
aspect_ratio | string | No | "auto" | One of auto, 1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2, 2:1, 21:9, 5:2. Single-image edits preserve source framing when left on auto. |
resolution | string | No | "1k" | 1k or 2k. (1.5k is exclusive to grok-imagine-image-2.0.) |
image_urls | string[] | No | — | 1–5 public HTTP(S) image URLs (JPEG, PNG, or WebP, ≤ 20 MiB each). Base64 strings and data: URIs are rejected. |
user | string | No | — | Optional end-user identifier for abuse monitoring (≤ 256 characters; API only). |
Pricing & billing behavior
- Flat per delivered image: See live rates on
/models/grok-imagine-imageorGET https://api.seedrouter.ai/v1/pricing. - 1K and 2K share one rate, and attaching
image_urlsadds no per-reference surcharge. - Delivered-count settlement: Multi-image batches settle only on the number of images actually delivered. Failed requests are not charged.
Text-to-image examples
# 1. Submit task
curl -sS https://api.seedrouter.ai/v1/images/generations \
-H "Authorization: Bearer $SEEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image",
"prompt": "Editorial studio still life of a matte ceramic espresso pour-over set on dark travertine stone, warm morning sidelight",
"n": 2,
"aspect_ratio": "4:3",
"resolution": "2k"
}'
# 2. Poll until status is "completed" or "failed"
curl -sS "https://api.seedrouter.ai/v1/tasks/${TASK_ID}" \
-H "Authorization: Bearer $SEEDROUTER_API_KEY"Image editing example
Attach 1–5 public HTTPS URLs in image_urls on the same POST /v1/images/generations endpoint:
curl -sS https://api.seedrouter.ai/v1/images/generations \
-H "Authorization: Bearer $SEEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image",
"prompt": "Place the ceramic vessel from <IMAGE_0> onto the sunlit linen table in <IMAGE_1>, matching warm directional shadows",
"image_urls": [
"https://example.com/vessel.png",
"https://example.com/table.jpg"
],
"resolution": "2k"
}'Task responses
Submission returns 200 OK immediately:
{
"id": "task_01j...",
"model": "grok-imagine-image",
"status": "processing",
"created_at": 1764140000
}Completed tasks return permanent CDN URLs in output.data:
{
"id": "task_01j...",
"model": "grok-imagine-image",
"status": "completed",
"created_at": 1764140000,
"finished_at": 1764140014,
"output": {
"created": 1764140014,
"data": [
{ "url": "https://static.seedrouter.ai/..." }
]
}
}See the shared error directory for full HTTP and public error.code documentation.
