GET
/v1/schemas/grok/image/v1%2Fimages%2Fedits
Accept:
Request body
10 properties · 1 required · 6 $defs| property | type | description | constraints |
|---|---|---|---|
| prompt* | string | Prompt for image editing. | |
| aspect_ratio | enum | Aspect ratio of the output image for image editing with multiple images. For single image editing, do not set this. It will always auto-detect from the input image. | 1:1 | 3:4 | 4:3 | 9:16 | 16:9 | 2:3 · +8 more · nullable |
| image | ImageUrl | Input image to perform edit on. Mutually exclusive with `images`. | nullable |
| images | ImageUrl[] | List of input images for multi-reference editing. Mutually exclusive with `image`. When multiple images are provided, refer to them as \<IMAGE_0\>, \<IMAGE_1\>, etc. in the prompt. | |
| model | any | Model to be used. | |
| n | any | Number of image edits to be generated. | format: int32 |
| resolution | enum | Resolution of the generated image. Defaults to `1k`. Only supported by grok-imagine models. | 1k | 2k · nullable |
| response_format | any | Response 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_options | StorageOptions | Optional 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 |
| user | any | A unique identifier representing your end-user, which can help xAI to monitor and detect abuse. |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"grok","endpointId":"v1/images/edits","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}