Edit Image with Form Data

POST/v1/images/edits
Edit an image with a multipart form-data request.

Request Body

multipart/form-data
image:optionalfile

Input image used for editing or generation.

prompt:optionalstring

Text instruction describing the requested output.

model:optionalstring

Model identifier used for this request.

Examplemix/gpt-image-2-pro
n:optionalstring

Number of results to generate.

Example1
size:optionalstring

Requested output image dimensions.

Allowed1024x10241536x10241024x15362048x20482048x11523840x21602160x3840auto
response_format:optionalstring

Format used to return generated media.

Allowedb64_jsonurl
Exampleurl

Response

200

A successful request returns a JSON response. The complete example is shown in the code panel.

Compatibility References

Use these external references to review additional parameters supported by compatible provider formats.