Grok Imagine Image 2.0 Official Generation and Editing
Asynchronous image generation and editing with grok-imagine-image-2.0
მთელი დოკუმენტაცია/v1/images/generationsNote
This is an asynchronous image endpoint. A successful submission returns a task ID. Poll Get Task Status for the final result. Omit
image_urlsfor text-to-image; include them for image editing or multi-image reference.
მოთხოვნის მაგალითები
curl --request POST \
--url https://api.apisea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-APISea-Response-Version: 2026-07-27' \
--data '{
"model": "grok-imagine-image-2.0",
"prompt": "A cinematic neon-lit city street in the rain",
"n": 1,
"aspect_ratio": "16:9",
"resolution": "2k",
"quality": "medium"
}'Model capabilities
| Model | Resolution | quality | Input images | Outputs |
|---|---|---|---|---|
grok-imagine-image-2.0 | 1k, 2k | low or medium for text-to-image only | 0–3 | 1–10 |
Authorization
AuthorizationstringrequiredUse Bearer YOUR_API_KEY.
Body
modelstringrequireddefault: grok-imagine-image-2.0Must be grok-imagine-image-2.0.
nsfw_checkbooleandefault: falseWhether to run content moderation before submitting the image task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
promptstringrequiredImage generation or editing instructions. Must be non-empty after trimming and no longer than 8,000 characters.
nintegerdefault: 1Number of output images, from 1 to 10.
aspect_ratiostringdefault: autoSupported values: 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, and auto.
resolutionstringdefault: 1k1k or 2k.
qualitystringText-to-image only: low or medium (default). Do not send this field when image_urls is present.
image_urlsarrayOne to three reference images. Only publicly accessible absolute HTTP(S) URLs are accepted. Upload local images with POST /v1/uploads/images, then use the returned url. Omit the field when there is no reference image.
Asynchronous task flow
The submission response uses HTTP 202; the task ID is in data.id. Use data.poll_url or GET /v1/tasks/{task_id} until the task becomes completed or failed. See Get Task Status.
Warning
Do not expose a long-lived APISea API key in browser code, public environment variables, URLs, local storage, or client logs. Call this endpoint from your backend or BFF.
პასუხები
{
"code": 202,
"request_id": "req_xxx",
"data": {
"id": "task_01KZQE5CM0Y3KZ6M1N1BK619MX",
"object": "generation.task",
"type": "image",
"status": "pending",
"progress": 0,
"poll_url": "/v1/tasks/task_01KZQE5CM0Y3KZ6M1N1BK619MX"
}
}ამ ენდპოინტის მომხმარებელი მოდელები
დოკუმენტაციაში შეცდომა შენიშნეთ? მოგვწერეთ ელფოსტაზე support@apisea.ai.