Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request payload for GPT Image 2 Edit model.

Request payload for GPT Image 2 Edit model.

prompt
string
required

Description of the desired edits, supports up to 32,000 characters

Required string length: 1 - 32000
Example:

"Add a watercolor effect to this image"

images
string[]
required

Input image URL(s) to edit. Direct HTTPS URLs as string array. Supports up to 16 images for GPT Image models

Required array length: 1 - 16 elements

Direct image URL (https only)

Example:
size
enum<string>
default:1024x1024

Output size as width x height, or 'auto' for model-selected size. Presets are valid under OpenAI constraints (total pixels 655360-8294400, edges multiples of 16). Mapping: 1:1 1K/2K; 3:2 1K/2K; 2:3 1K/2K; 4:3 1K/2K; 3:4 1K/2K; 16:9 2K/4K; 9:16 2K/4K. No 1K for 16:9/9:16; no 4K for non-widescreen ratios.

Available options:
auto,
1024x1024,
2048x2048,
1536x1024,
3072x2048,
1024x1536,
2048x3072,
1024x768,
2048x1536,
768x1024,
1536x2048,
2048x1152,
3840x2160,
1152x2048,
2160x3840
Example:

"1024x1024"

quality
enum<string>
default:low

Output quality level. 'low': fast draft (default), 'medium': balanced, 'high': best quality

Available options:
low,
medium,
high
Example:

"high"

mask
string

Optional mask URL. Must be PNG with alpha channel; dimensions must match the input image exactly. Transparent areas are edited, opaque areas locked, semi-transparent areas blend with the original.

Example:

"https://example.com/mask.png"

Response

Task submitted successfully

Response object for asynchronous task submission.

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required

Detailed data about the submitted asynchronous task.