POST /v1/images/edits uses multipart form-data.
Use this endpoint when you want to modify one or more uploaded images rather than generate a new image from scratch.
Common fields
| Field | Required | Notes |
|---|---|---|
model | Yes | Image editing model |
prompt | Yes | Edit instruction |
image | Yes | One uploaded image, or use repeated image fields when supported |
mask | No | Optional mask to constrain the editable region |
response_format | No | url or b64_json |
Multipart Example
Notes
- at least one image must be provided
maskis optionalresponse_formatcan beurlorb64_json- prompt and output usage are tracked separately from input image usage
Common mistakes
- sending JSON instead of multipart form-data
- forgetting that
maskis optional but uploaded images are not - using image edits when plain image generation would be simpler