Skip to main content
POST

Authentication and headers

string
required
The generation and task query endpoints use a platform API Key for Bearer Token authentication. Get a key from the API Key management page.
Query the task using an API Key belonging to the same platform user.
string
required
Use application/json for submission. Both text-to-image and image-to-image use a JSON request body.

Version selection

Request parameters

string
required
Fixed value: gpt-image-2.5-ext.
string
default:"flare"
Model version. Options: flare, sunburst.
string
required
The prompt for image generation or editing. It must not be empty after trimming leading and trailing whitespace.For image-to-image, describe what to preserve and what to change in the reference images.
string
default:"1K"
Output resolution tier. Options: 1K, 2K, 4K.
string
default:"auto"
Output aspect ratio. Choose auto or one of the following 10 ratios:1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9.
integer
default:"1"
The number of images to generate per request. Must be an integer from 1 to 4.
string[]
An array of up to 16 reference images. Omit reference images for text-to-image; include them for image-to-image. Reference images incur no additional charge.Supported input formats:
  • Accessible image URLs
  • Data URL: data:image/...;base64,...

Usage examples

The following are JSON request bodies for POST /v1/images/generations. Use the authentication and recommended headers described above. Replace the reference image placeholders with real, accessible image URLs.

Text-to-image

Image-to-image with Sunburst

Multiple reference images and outputs

Automatic aspect ratio and 4K resolution

Query task results

Use the task ID to call the task query endpoint:

Successful task

The task ID, timestamps, URLs, and amounts below illustrate the response structure only. They do not represent a real task or actual prices.

Response

integer
Response status code. A successful submission in the unified format returns 200.
string
The identifier for this request, used for troubleshooting.
object
The accepted asynchronous task.