Skip to main content
Last updated: 2026-06-06

Grok Image Models

Grok image models use the OpenAI-compatible Images path. There are two names you should treat differently:
grok-4-image is not the official xAI model name. Do not assume it is fully equivalent to grok-4-image. New integrations should prefer grok-4-image.

grok-4-image Parameters

aspect_ratio and resolution are xAI image endpoint extensions. With the OpenAI Python SDK, pass them through extra_body; with cURL or the Node.js SDK, put them directly in the JSON body.
Do not pass these parameters:

grok-4-image Example

Response Example

The live response may include url, mime_type, and revised_prompt:

grok-4-image Differences

Use only this safe subset for grok-4-image: Do not promise these for grok-4-image:
  • multi-image n > 1
  • guaranteed b64_json output
  • size
  • quality
  • style
  • image editing

grok-4-image Example

Billing

The live pricing page and usage logs are the source of truth. Grok image models are billed per image, not by input/output tokens.

Common Errors