Edit Image with JSON

POST/v1/images/edits
Edit an image using a JSON request body.

Request Body

application/json
prompt:requiredstring

Text instruction describing the requested output.

Example图片改为吉卜力风格
model:requiredstring

Model identifier used for this request.

Examplegpt-image-2-ad
n:optionalstring

Number of results to generate.

size:optionalstring

Requested output image dimensions.

Allowed1024x10241536x10241024x15362048x20482048x11523840x21602160x3840auto
Exampleauto
type:optionalstring

Response representation requested from the endpoint.

Allowedurl
Exampleurl
reference_images:requiredarray

Reference images supplied to the model.

Example["https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTadhETeWmB0HglBew1luqsPidqb-KtfA17dab-V9r1b3KOThS7JZlNwKw&s=10"]

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.