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.

ModelResolution / qualityPer output imagePer reference
grok-imagine-1.5-extFixed0.017Free
grok-imagine-image1K / 2K0.0170.0017
grok-imagine-image-2.01K low0.0340.0085
grok-imagine-image-2.01K medium / 2K low0.0510.0085
grok-imagine-image-2.02K medium0.0680.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}'
  • prompt accepts 1–8,000 characters.
  • n accepts 1–10.
  • resolution defaults to 1k and also accepts 2k.
  • size accepts 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, and 2:1.
  • quality accepts low or medium for Image 2.0 text-to-image and defaults to medium. Omit it for Image 1.0 and reference-image editing.
  • image_urls takes 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

ModelOperationPrice
grok-imagine-1.0-extGenerate one imageUS$0.017 per image
grok-imagine-1.0-edit-extEdit one imageUS$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.

  • size defaults to 1:1 and also supports 16:9, 9:16, 3:2, and 2:3.
  • Omit resolution and quality.
  • 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.