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_KEYImage Editing
POST /v1/images/editsForm fields (native OpenAI):
model(required)image(required): Original image file; multiple images may be provided, depending on model supportprompt(required): Editing instructionsmask(optional): PNG mask; transparent areas indicate regions to be redrawn, and its dimensions must match the original imagen,size,quality,response_format: Passed through according to model support
Image Variations
POST /v1/images/variationsForm 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
imagefiles and masks varies by model; refer to the official upstream documentation for the relevant model
