Skip to content

Edit Image

POST
/v1/images/edits
  • Edit images using Grok models
  • Official documentation: Image Edits

Authorizations

bearer
Type
HTTP (bearer)

Request Body

multipart/form-data
object

Model used to generate the image.

Prompt for editing the image.

Image to edit. Supports uploading 1 image.

Format"binary"

Optional. Aspect ratio: 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 | auto

Optional. Output format: b64_json or url

Optional. Resolution: 1k | 2k

Optional. Quality: low | medium | high

Optional. Number of output images. Default is 1, maximum is 10.

Responses

Success

application/json
object
object[]
object

Playground

Authorization
Body

Samples