Skip to main content
POST

Headers

string
required
Bearer token authentication. Format: Bearer <token>

Body

Format: multipart/form-data
file
required
The image to edit. Must be a valid PNG file, less than 4MB, and square. If no mask is provided, the image must have transparency, which will be used as the mask.Format: binary
file
An additional image whose fully transparent areas (e.g., where alpha is zero) indicate where the image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as the original image.Format: binary
string
required
A text description of the desired image. Maximum length is 1,000 characters.
string
The number of images to generate. Must be between 1 and 10.
string
The size of the generated image. Must be one of 256x256, 512x512, or 1024x1024.
string
The format in which the generated images are returned. Must be url or b64_json.
string
A unique identifier representing your end user, which can help OpenAI monitor and detect abuse. Learn more.
string
Model ID.

Response

200

Format: application/json
integer
Creation timestamp (Unix time).
object[]
List of edited images.
Last modified on October 28, 2026