GET

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

kind inputactivity imagehash a0c734adextracted Jul 6, 2026version currentsource upstream spec ↗

Request body

8 properties · 0 required · 5 $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`, or `auto`. Defaults to `auto` for automatically selecting the best ratio for the prompt. Only supported by grok-ima…1:1 | 3:4 | 4:3 | 9:16 | 16:9 | 2:3 · +8 more · nullable
modelanyModel to be used.
nanyNumber of images to be generated1 ≤ n ≤ 10 · format: int32 · default: 1
promptstringPrompt for image generation.
resolutionenumResolution of the generated image. Defaults to `1k`. Only supported by grok-imagine models.1k | 2k · 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.

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", …}]}