Skip to main content
Use one GPT Image 2.5 model ID with the generation or editing endpoint.
GPT Image 2.5 always returns Base64-encoded image data in data[].b64_json. Do not send the DALL·E-only response_format parameter.

Generate images

POST /v1/images/generations
cURL

Request headers

string
required
Bearer authentication in the form Bearer YOUR_API_KEY.
string
default:"application/json"
required
Data exchange format.

Request body

string
required
Model ID: gpt-image-2.5-sunburst or gpt-image-2.5-flare.
string
required
Text description of the image to generate. Length: 132,000 characters.
integer
default:1
Number of images to generate. Supported range: 110.
string
default:"auto"
auto or a custom WIDTHxHEIGHT value. Width and height must be multiples of 16, the aspect ratio must be between 1:3 and 3:1, neither edge may exceed 3,840 pixels, and total pixels must be between 655,360 and 8,294,400.
string
default:"auto"
Rendering quality: low, medium, high, xhigh, max, or auto.
string
default:"auto"
Background mode: auto, opaque, or transparent. Transparent backgrounds require PNG or WebP output.
string
default:"png"
Output format: png, jpeg, or webp.
integer
default:100
JPEG or WebP compression level from 0 through 100. Ignored for PNG output.
string
default:"auto"
Moderation strictness: auto or low.

Generation response

200
integer
Creation time as a Unix timestamp in seconds.
string
Resolved background mode: opaque or transparent.
object[]
Generated image results.
string
Base64-encoded image data.
string
Returned image format: png, jpeg, or webp.
string
Quality level used for the result.
string
Resolved output dimensions as WIDTHxHEIGHT.

Validation rules

  • background="transparent" requires output_format="png" or output_format="webp".
  • Custom width and height must be divisible by 16, use an aspect ratio from 1:3 through 3:1, keep each edge at or below 3,840 pixels, and contain 655,360–8,294,400 total pixels.
  • Resolutions above 2560x1440 are experimental.
  • output_compression applies only to JPEG and WebP output.
  • GPT Image 2.5 returns Base64 image data; URL output through response_format is not supported.
See the OpenAI create image reference and create image edit reference for the upstream contract.