latestOpenAPI 3.1.02026-08-221050568.9 KB

316fd317ad58

Image

Grok Imagine 2.0

xAI's image model with selectable quality and 2K output.

post/generate/image/xai/grok-imagine-2

Headers

X-Webhook-URLstring uri

URL to receive a POST request when the job completes. The webhook will receive the job data including results.

Request body

promptstring required
quality'low' | 'medium'
aspect_ratio'2:1' | '20:9' | '19.5:9' | '16:9' | '3:2' | '4:3' | '1:1' | '3:4' | '2:3' | '9:16' | '9:19.5' | '9:20' | '1:2' required

Aspect ratio. One of: 2:1, 20:9, 19.5:9, 16:9, 3:2, 4:3, 1:1, 3:4, 2:3, 9:16, 9:19.5, 9:20, 1:2.

resolution'1K' | '2K' required

Resolution scale. One of: 1K, 2K.

Response

The resulting job data. This will be returned in a pending state until the job is completed. See /jobs/{id} for retrieving the results.

job_idstring uuid required
status'backlogged' | 'queued' | 'scheduled' | 'processing' | 'sampling' | 'intermediate-complete' | 'completed' | 'failed' | 'cancelled' required
created_atstring date-time required
{"stackTrail":"paths:/generate/image/xai/grok-imagine-2:post:responses:200:content:application/json:schema:properties:completed_at","oasType":"schema","type":"unknown"}
{"stackTrail":"paths:/generate/image/xai/grok-imagine-2:post:responses:200:content:application/json:schema:properties:result","oasType":"schema","type":"unknown"}