Image edits
Change an existing image from a text prompt, with an optional mask for inpainting, in the OpenAI images shape. Admitted, held, settled and billed like image generation, on the models certified for edits.
Body
application/json, or multipart/form-data as OpenAI's SDKs send it; up to 4 MiB- modelstringrequired
An image model certified for edits.
GET /v1/modelsmarks them withedits: true; others are refused with400 invalid_request. - promptstringrequired
What to change, up to 32,000 characters.
- imagesarrayrequired
One to four input images, each
{ "image_url": … }: anhttpsURL the provider fetches, or a base64 data URL of a PNG, JPEG or WebP image. In a multipart form, send them asimageorimage[]files. Large images are better sent as URLs, to stay under the request limit. - maskobjectoptional
Where to edit, as
{ "image_url": … }or amaskfile: transparent pixels mark the area to change. Inpainting models such asbfl/flux-pro-1.0-fillneed one. - n, size, response_format, providerOptions, user, iboptional
As for image generation. In a multipart form, send
providerOptionsas a JSON string.
Notes
- Costoptional
Held and settled as for generation. On token-priced models the input images are billed too: each is held at the most input tokens one took when we measured it at the highest input fidelity, priced at the output rate, which is above what providers charge for image input.
- Logsoptional
When your team keeps request content, the stored request shows each input image's size, not the image.