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.5 Flare Edit.

Request payload shared by GPT Image 2.5 Sunburst Edit and Flare Edit.

prompt
string
required

Description of the desired edits, from 1 to 32,000 Unicode characters.

Required string length: 1 - 32000
Example:

"Replace the red square with a green circle"

images
string<uri>[]
required

Input image URLs as a string array, with 1 to 16 images.

Required array length: 1 - 16 elements
Minimum string length: 1
Example:
mask
string<uri>

Optional PNG mask URL for local editing. The mask must have an alpha channel and match the first input image's dimensions. Transparent areas indicate the area to edit.

Minimum string length: 1
Example:

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

aspect_ratio
enum<string>
default:1:1

Output aspect ratio. Can be set independently of resolution; omitting it uses 1:1.

Available options:
1:1,
3:2,
2:3,
3:4,
4:3,
4:5,
5:4,
9:16,
16:9,
21:9
Example:

"16:9"

resolution
enum<string>
default:1K

Output resolution tier. Can be set independently of aspect_ratio; omitting it uses 1K. Pixel dimensions depend on both parameters: 1:1 + 1K gives 1024x1024, 1:1 + 4K gives 2880x2880, and 16:9 + 4K gives 3840x2160.

Available options:
1K,
2K,
4K
Example:

"4K"

quality
enum<string>
default:low

Output quality level. Defaults to low.

Available options:
low,
medium,
high,
xhigh,
max
Example:

"high"

background
enum<string>
default:auto

Background mode: auto lets the model choose, opaque requests an opaque background, and transparent requests a transparent background with PNG output.

Available options:
auto,
opaque,
transparent
Example:

"transparent"

Response

Task submitted successfully. Poll the URL in data.get_result.url using Query Task Result to retrieve the generated image.

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.