Edit an image
Edits uploaded images against a text prompt and charges the account for what it counted. Requires an API key. /v1/images/generations draws from a prompt alone.
Authorizations
An account API key. Send it as Authorization: Bearer <key>.
Body
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.
The model to edit with, named by its id or alias.
What to change, in words. One to 32000 characters.
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.
The provider's background knob, passed through unchecked. A provider without one drops it.
A single image whose transparent area marks what the model may repaint.
How many images to ask for. Absent means one; a value above what the model declares draws a refusal.
The provider's quality knob, passed through unchecked. A provider without one drops it.
Whether each image comes back as a link (url) or as inline base64 (b64_json).
url, b64_json 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.