GET

/v1/schemas/grok/image/v1%2Fimages%2Fgenerations

kind inputactivity imagehash 215add3d…extracted Oct 23, 2026version currentsource upstream spec ↗

Request body

11 properties · 0 required · 6 $defs
propertytypedescriptionconstraints
aspect_ratioenumAspect ratio of the generated image. Can be `1:1`, `3:4`, `4:3`, `9:16`, `16:9`, `2:3`, `3:2`, `9:19.5`, `19.5:9`, `9:20`, `20:9`, `1:2`, `2:1`, `21:9`, `5:2`, or `auto`. Defaults to `auto` for automatically selecting the best ratio for the prompt. Only suppor…1:1 | 3:4 | 4:3 | 9:16 | 16:9 | 2:3 · +10 more · nullable
deferredanyIf set, the request returns immediately with a `request_id` and the image is generated in the background. Poll `GET /v1/images/{request_id}` for the result. Only `response_format: "url"` is supported in this mode.
modelanyModel to be used.
nanyNumber of images to be generated1 ≤ n ≤ 10 · format: int32 · default: 1
outputImageOutputOptional output destination. When present, each generated image is uploaded via HTTP PUT to the matching signed URL instead of xAI-hosted storage and the response `url` is that upload URL. Requires `response_format: "url"`; Zero Data Retention teams must set t…nullable
promptstringPrompt for image generation.
resolutionenumResolution of the generated image. Defaults to `1k`. Only supported by grok-imagine models.1k | 2k | 1.5k · nullable
response_formatanyResponse format to return the image in. Can be url or b64_json. If b64_json is specified, the image will be returned as a base64-encoded string instead of a url to the generated image file.default: "url"
storage_optionsStorageOptionsOptional output storage configuration. When present, the generated image(s) are stored in the Files API and a `file_output` reference is returned in the response alongside the ephemeral URL.nullable
useranyA unique identifier representing your end-user, which can help xAI to monitor and detect abuse.
qualityenumGeneration quality. Defaults to `auto`, which serves `low` for generation and `medium` for editing; images are billed at the quality served. Only supported by grok-imagine-image-2.0. Documented in the image generation guide and the official TypeScript SDK, abs…low | medium | auto

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"grok","endpointId":"v1/images/generations","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}