API docs / Image models

Grok Imagine Image 2.0 (Edit image) API

Edit up to five reference images with Grok Imagine Image 2.0.

Model id
xai/grok-imagine-image/v2.0/edit
Provider
xAI
Output
Image
Price
From 25 credits per run, the same as on voor.ai. Options such as length or resolution can change it.

Request

POST https://voor.ai/v1/generations with "model": "xai/grok-imagine-image/v2.0/edit". Poll GET /v1/tasks/{id} or receive the signed webhook. See the overview for keys, idempotency, webhooks and errors.

curl https://voor.ai/v1/generations \
  -H "Authorization: Bearer $VOOR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "model": "xai/grok-imagine-image/v2.0/edit",
  "input": {
    "prompt": "A red fox standing in fresh snow at golden hour, soft light",
    "reference_images": [
      "https://example.com/input.png"
    ]
  },
  "callback_url": "https://example.com/webhooks/voor"
}'

# Then poll the task (or wait for the webhook):
curl https://voor.ai/v1/tasks/TASK_ID \
  -H "Authorization: Bearer $VOOR_API_KEY"

Input parameters

NameTypeDetails
promptrequiredstring

Say what to change and what must stay. Quote any new text exactly.

Up to 8000 characters

reference_imagesrequiredarray of URLs

Up to 5 images. Each reference adds a small charge.

Up to 5 files · Accepts image/*

aspect_ratiostring

Auto keeps the aspect ratio of the first reference image.

Default: auto

One of: auto, 2:1, 20:9, 19.5:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:19.5, 9:20, 1:2

resolutionstring

1k is about one megapixel in total; 2k is about four megapixels and costs more.

Default: 1k

One of: 1k, 2k

qualitystring

Low is much faster and cheaper; medium renders finer detail.

Default: medium

One of: low, medium

output_formatstring

The file format of the generated image.

Default: jpeg

One of: jpeg, png, webp