API / migrate-from-grok-imagine-image-quality

API

Migrate from grok-imagine-image-quality before November 2

Migrate from grok-imagine-image-quality before November 2

On November 2, 2026, the API slug grok-imagine-image-quality retires. After that date, requests to it are served by grok-imagine-image-2.0 with quality set to "low". The slug still resolves (no hard break), but pricing follows Image 2.0 at low. Notice started September 2, 2026. grok-imagine-image (1.0) is unchanged. grok-imagine-image-pro already redirected to quality and follows it to 2.0 at low.

One-line change

Set model to grok-imagine-image-2.0 and pick quality yourself so you are not stuck on the redirect’s low default.

curl -X POST https://api.x.ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
    "model": "grok-imagine-image-2.0",
    "prompt": "A watercolor painting of a lighthouse at dawn",
    "quality": "low"
  }'
import xai_sdk

client = xai_sdk.Client()

response = client.image.sample(
    prompt="A watercolor painting of a lighthouse at dawn",
    model="grok-imagine-image-2.0",
    quality="low",
)
print(response.url)

OpenAI SDK: pass quality via extra_body={"quality": "low"} on images.generate. The same model change applies to /v1/images/edits.

Quality choices on 2.0

quality When to use
low Closest cost match to the old Quality slug; what the redirect uses
medium More detail when quality beats price
auto Default when omitted; currently low for generation and medium for editing; billed at the quality served

Image 2.0 also accepts up to five source images on edits and aspect ratios 21:9 and 5:2. Confirm the serving model from the model field on the response.

Pricing

grok-imagine-image-2.0 at low is $0.01 per image cheaper than grok-imagine-image-quality at every resolution. Keeping the retired slug after November 2 bills at the 2.0 low rate. See current numbers on the xAI Pricing page.

Pitfalls

  • Leaving the old slug and assuming Quality-era pricing forever — after November 2 you get 2.0 low rates.
  • Skipping an explicit quality when you need medium detail — auto may serve low on generation.
  • Migrating grok-imagine-image (1.0) — that slug is out of scope for this retirement.