Skip to main content
xAIFastStandard

Grok Imagine Image

Generate images using xAI's Grok Imagine model over the direct xAI API - fast, low-cost text-to-image generation. For editing an existing image, use xai/grok-imagine-image/edit.

47 credits
per image
Fast, low-cost text-to-image generation
Up to 10 images per request (billed per image)
14 aspect ratio presets plus an auto option
1k / 2k output resolution tiers at the same price

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Quick Start

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-image",
  "input": {
    "prompt": "A futuristic city skyline at sunset, flying vehicles, neon reflections on glass towers",
    "aspect_ratio": "16:9"
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Text prompt for image generation
nintegerNo1Number of images to generate (1-10). Billed per image.
aspect_ratiostringNoautoAspect ratio of the generated image.
auto1:116:99:164:33:43:22:32:11:219.5:99:19.520:99:20
resolutionstringNo-Output resolution tier. Same price for both.
1k2k

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

Text-to-image generation

Generates a new image from a text prompt at a 16:9 aspect ratio.

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-image",
  "input": {
    "prompt": "A futuristic city skyline at sunset, flying vehicles, neon reflections on glass towers",
    "aspect_ratio": "16:9"
  }
}'

Batch variations

Generate 4 variations of the same prompt in one request.

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-image",
  "input": {
    "prompt": "A minimalist logo concept for a coffee brand, flat design",
    "n": 4,
    "aspect_ratio": "1:1"
  }
}'

Tips & Best Practices

1To edit an existing image, use xai/grok-imagine-image/edit โ€” this model no longer takes an image input
2Use aspect_ratio=auto to let the model choose a sensible ratio for the prompt
32k resolution costs the same as 1k
4Step up to grok-imagine-image-2.0 or -quality when you need precision or fidelity

Use Cases

Rapidly iterating on image concepts from text prompts
Generating images across varied aspect ratios for social posts, wide banners, and mobile screens
Bulk concept exploration with the n parameter