Image Editing / Variations

OpenAI Images native protocol: upload the original image via multipart for editing or generating variations, with synchronous responses

POST/v1/images/edits

Image editing and variations use the native OpenAI endpoints. Requests use multipart/form-data (image files are uploaded with the request; this is the only way to upload files directly on the platform), and results are returned synchronously, with no polling required.

Authorizations

AuthorizationstringRequired

Bearer Token authentication.

Authorization: Bearer YOUR_API_KEY

Image Editing

POST /v1/images/edits

Form fields (native OpenAI):

  • model (required)
  • image (required): Original image file; multiple images may be provided, depending on model support
  • prompt (required): Editing instructions
  • mask (optional): PNG mask; transparent areas indicate regions to be redrawn, and its dimensions must match the original image
  • n, size, quality, response_format: Passed through according to model support

Image Variations

POST /v1/images/variations

Form fields: model, image (required, original image), n, size, response_format.

Notes

  • Long-running synchronous requests; a client timeout of ≥ 180 seconds is recommended
  • The total request body size, including image files, is limited to 32 MB
  • Support for the number / format of image files and masks varies by model; refer to the official upstream documentation for the relevant model