Skip to main content
POST
curl

Authorizations

Authorization
string
header
required

An account API key. Send it as Authorization: Bearer <key>.

Body

multipart/form-data

The images to edit, one per part named image, beside the prompt to edit them against and the fields POST /v1/images/generations takes in JSON.

The multipart/form-data body of POST /v1/images/edits — the images to edit, the prompt to edit them against, and the fields POST /v1/images/generations takes in JSON.

model
string
required

The model to edit with, named by its id or alias.

prompt
string
required

What to change, in words. One to 32000 characters.

image
file[]
required

The images to edit, one per part named image; image[] merges into the same list.

One uploaded image, as the bytes of the file itself.

background
string | null

The provider's background knob, passed through unchecked. A provider without one drops it.

mask
file | null

A single image whose transparent area marks what the model may repaint.

n
integer<int64> | null

How many images to ask for. Absent means one; a value above what the model declares draws a refusal.

quality
string | null

The provider's quality knob, passed through unchecked. A provider without one drops it.

response_format
enum<string>
default:url

Whether each image comes back as a link (url) or as inline base64 (b64_json).

Available options:
url,
b64_json
size
string | null

The requested image size, written {width}x{height}; any other shape draws a refusal.

Response

The edited images, in the same body POST /v1/images/generations answers with.

The body both image routes answer with.

created
integer<int64>
required

When the gateway rendered this body, in seconds since the Unix epoch.

data
object[]
required

The produced images, in the order the provider returned them.

usage
object
required

What the gateway metered, filling in where the provider reported nothing.