Skip to content

Grok Imagine Image Generation ​

xAI Grok Imagine image models with text-to-image and image-to-image support, returning OpenAI-compatible output. grok-imagine-image-2.0 adds resolution × quality pricing.

Endpoint ​

POST $URL/v1/images/generations

Supported Models ​

ModelPositioningResolutionQuality
grok-imagine-imageStandard, text/image-to-image1k / 2k—
grok-imagine-image-qualityHigh-quality tier1k / 2k—
grok-imagine-image-2.0Latest, quality control1k / 2klow / medium / auto

Parameters ​

ParameterTypeRequiredDescription
modelstringYesOne of the models above
promptstringYesImage description
nintegerNoNumber of images 1–10, default 1
resolutionstringNo1k (default) / 2k
qualitystringNolow / medium / auto, only on grok-imagine-image-2.0; auto lets the service choose (currently billed as low)
aspect_ratiostringNo1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 21:9 etc., default auto
imagestring | objectNoImage-to-image: reference image URL / base64; use images array for multiple references
response_formatstringNourl (default, temporary links) / b64_json

Request Example ​

bash
curl $URL/v1/images/generations \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-image-2.0",
    "prompt": "A cat wearing sunglasses walking down a neon street",
    "n": 1,
    "resolution": "2k",
    "quality": "medium"
  }'

Pricing ​

Billed per output image (resolution × quality); reference images are billed per input image (aligned with xAI official prices):

Model1K2KInput image
grok-imagine-image$0.02 / image$0.02 / image$0.002 / image
grok-imagine-image-quality$0.05 / image$0.07 / image$0.01 / image
grok-imagine-image-2.0Low $0.04 / Medium $0.06Low $0.06 / Medium $0.08$0.01 / image

Example: one grok-imagine-image-2.0 2K·Medium image = $0.08; n=4 is billed as 4 output images.

Notes ​

  • Result URLs are temporary — download promptly (or request response_format: "b64_json");
  • quality defaults to auto, chosen server-side (currently low for generation);
  • Group multipliers apply on top of the base prices above.

© 2026 Euno AI. All rights reserved.