OpenAI Images Compatible Image Editing
OpenAI Images Compatible
OpenAI Images Compatible Image Editing
Use POST /v1/images/edits or POST /v1/edits to perform editing, inpainting, and image-to-image generation based on existing images.
POST
OpenAI Images Compatible Image Editing
OpenAI Images Compatible Image Editing
Image editing uses the same model family as generation, but the entry point is switched to the edit route.- Compatible with both
POST /v1/images/editsandPOST /v1/edits. - Supports both
multipart/form-dataand JSON request bodies. - Passing
imageenables image-to-image generation; additionally passingmaskenables inpainting. gpt-image-1defaults toquality = standardin editing scenarios, and whennis omitted or set to0, it falls back to1.
Method and Path
Request Examples
Response Examples
Authentication
Body
file | string | object
required
The input image for editing. Under
multipart/form-data, this is usually a file; in JSON scenarios, it can be a URL, Base64, or an object structure.string
required
Editing instructions. Used to describe what to keep and what to modify.
string
Model name. If not provided, whether there is a default behavior depends on the upstream service; omitting it is not recommended.
file | string | object
Inpainting mask. Transparent areas usually indicate the regions that may be edited.
integer
Number of outputs. When omitted or explicitly set to
0, the unified layer falls back to 1.string
Output size. The available values depend on the target model.
string
Quality field. For
gpt-image-1, the editing form defaults to standard.boolean
Explicit watermark switch. Explicitly passing
false means it is turned off; omitting it means the default policy is used.Response
integer
Timestamp of when the edited result was generated.
string
URL of the resulting image.
string
Image data returned when the request uses Base64 format.
string
The editing prompt possibly rewritten by the upstream service.