Edit image

Creates an edited image from one or more source images and a prompt.

post/v1/images/edits

Request body

promptstring required

A text description of the desired image edit.

background'transparent' | 'opaque' | 'auto'

Background behavior for generated image output.

input_fidelity'high' | 'low'

Controls fidelity to the original input image(s).

modelstring

The model to use for image editing.

ninteger

The number of edited images to generate.

output_compressioninteger

Compression level for jpeg or webp output.

output_format'png' | 'jpeg' | 'webp'

Output image format.

quality'low' | 'medium' | 'high' | 'auto'

Output quality for image models.

sizestring

Requested output image size. Supported values depend on the model and provider.

aspect_ratiostring

The aspect ratio of the edited images (e.g. '1:1', '16:9', '4:3', '5:4'). Takes precedence over size-derived defaults.

Example request

{
  "images": [
    {
      "image_url": "https://example.com/source-image.png"
    }
  ],
  "prompt": "Add a watercolor effect to this image",
  "background": "transparent",
  "input_fidelity": "high",
  "model": "gemini-3-pro-image",
  "n": 1,
  "output_compression": 100,
  "output_format": "png",
  "quality": "high",
  "size": "1024x1024",
  "aspect_ratio": "16:9"
}

Response

Image edit response.

creatednumber required
background'transparent' | 'opaque'
output_format'png' | 'webp' | 'jpeg'
quality'low' | 'medium' | 'high'
sizestring

Changes

No recorded changes to this endpoint across all 1 revision of this API.