Skip to main content
POST
Edit image

Authorizations

Authorization
string
header
required

API key (sk-xxx)

Body

model
string
required
Example:

"gpt-image-2"

prompt
string
required
image
string

Image to edit. JSON requests can pass a URL or Base64 data; multipart/form-data requests can upload a file.

mask
file
quality
string
n
integer
size
string
response_format
string
stream
boolean
background
any

Background setting. Depends on support from the selected model.

output_format
any

Output format. Depends on support from the selected model.

partial_images
any

Partial image return setting. Depends on support from the selected model.

Response

200 - application/json

Image generated successfully

created
integer
data
object[]