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
| Method | Path |
|---|---|
POST | /v1/images/edits |
POST | /v1/edits |
Request Examples
Response Examples
Authentication
Body
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.Editing instructions. Used to describe what to keep and what to modify.
Model name. If not provided, whether there is a default behavior depends on the upstream service; omitting it is not recommended.
Inpainting mask. Transparent areas usually indicate the regions that may be edited.
Number of outputs. When omitted or explicitly set to
0, the unified layer falls back to 1.Output size. The available values depend on the target model.
Quality field. For
gpt-image-1, the editing form defaults to standard.Explicit watermark switch. Explicitly passing
false means it is turned off; omitting it means the default policy is used.Response
Timestamp of when the edited result was generated.
URL of the resulting image.
Image data returned when the request uses Base64 format.
The editing prompt possibly rewritten by the upstream service.