Grok Imagine image API
Generate and edit images, query asynchronous tasks, and understand image pricing.
Use an Official Group API key with https://app.apipool.dev.
Models and pricing
Prices are in US dollars and include the group discount. The standard models charge for each delivered image plus each reference image per request. Reference charges do not multiply with the number of outputs.
| Model | Resolution / quality | Per output image | Per reference |
|---|---|---|---|
grok-imagine-1.5-ext | Fixed | 0.017 | Free |
grok-imagine-image | 1K / 2K | 0.017 | 0.0017 |
grok-imagine-image-2.0 | 1K low | 0.034 | 0.0085 |
grok-imagine-image-2.0 | 1K medium / 2K low | 0.051 | 0.0085 |
grok-imagine-image-2.0 | 2K medium | 0.068 | 0.0085 |
Image 2.0 uses the medium tier for reference-image edits. Omit quality when editing.
Quality compatibility endpoint
grok-imagine-image-quality is a compatibility ID retained by the channel, available in the official group. APIPool supports one 1K square image per text-to-image request, at US$0.0425 per successfully delivered image.
Submit model and prompt to POST /v1/images/generations. Only n=1, size=1:1 and resolution=1k are accepted; omitting them uses these defaults. Omit quality and reference images. Editing, multiple outputs, 2K and other aspect ratios are not available.
{"model":"grok-imagine-image-quality","prompt":"A green ceramic cup on a white table","n":1,"size":"1:1","resolution":"1k"}Poll GET /v1/tasks/{task_id} for the final image. Failed tasks are not charged. This compatibility ID does not provide a selectable high-quality tier or promise a distinct original-provider model or better image quality than Image 2.0; the channel currently prices this ID separately. For explicit Image 2.0 quality options, use grok-imagine-image-2.0.
Generate and edit
curl https://app.apipool.dev/v1/images/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-image-2.0","prompt":"A green ceramic cup on a gray table","size":"1:1","resolution":"1k","quality":"medium","n":1}'promptaccepts 1–8,000 characters.naccepts 1–10.resolutiondefaults to1kand also accepts2k.sizeacceptsauto,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, and2:1.qualityacceptslowormediumfor Image 2.0 text-to-image and defaults tomedium. Omit it for Image 1.0 and reference-image editing.image_urlstakes distinct public HTTP(S) image URLs. Image 1.0 accepts up to five references and Image 2.0 accepts up to three. The first reference is also billed.
For local files, send multipart image files and the model and prompt fields to POST /v1/images/edits. Omit quality. Masks, region editing, built-in moderation, and other extended options are unavailable.
Imagine 1.0 single-image endpoints
| Model | Operation | Price |
|---|---|---|
grok-imagine-1.0-ext | Generate one image | US$0.017 per image |
grok-imagine-1.0-edit-ext | Edit one image | US$0.0187 per successful task, including one reference |
Use POST /v1/images/generations. n and size default to 1 and 1:1, the only supported values. prompt accepts 1–8,000 characters. Omit resolution, quality, and other extended fields.
The generation model takes text only. The editing model requires exactly one public HTTP(S) URL in image_urls or a single multipart image file sent to POST /v1/images/edits.
curl https://app.apipool.dev/v1/images/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-1.0-edit-ext","prompt":"Make the cup blue and keep the composition","n":1,"size":"1:1","image_urls":["https://example.com/cup.jpg"]}'Each successful task delivers one image. Failed tasks are free. The price rounds to the nearest US$0.000001.
Imagine 1.5 Ext
grok-imagine-1.5-ext uses the same generation and editing endpoints, with 1–10 outputs and up to five references. References are free.
sizedefaults to1:1and also supports16:9,9:16,3:2, and2:3.- Omit
resolutionandquality. - The per-image rate rounds to the nearest US$0.000001. Billing uses the number of images delivered.
Results and playground
Save the task ID returned at submission and use the same API key with GET /v1/tasks/{task_id} until the status is completed or failed. Save completed images before their URLs expire. See asynchronous image tasks.
Open a model in the Official Group catalog for its active price and playground. After a network disconnect, check the existing task before submitting another request.