Skip to main content
Use one GPT Image 2.6 model ID with the generation or editing endpoint. GPT Image 2.6 adds complexity control for image planning; the direct AnyFast examples below use fields supported by the current endpoint.
GPT Image 2.6 returns Base64-encoded image data in data[].b64_json. Responses also include data[].revised_prompt and token usage accounting. 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.6-sunburst or gpt-image-2.6-flare.
string
required
Text description of the image to generate. Length: 1–32,000 characters.
integer
default:1
Number of images to generate. Supported range: 1–10.
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:"high"
Planning effort: low, medium, or high. Higher complexity can help with dense text and complex layouts but may increase latency.
string
default:"auto"
Background mode: auto, opaque, or transparent. Transparent backgrounds require PNG or WebP output.
string
default:"png"
Output format: png, jpeg, webp, or gif. GIF generation also requires frame_count and frame_duration_ms.
integer
default:9
Number of GIF frames, from 2 through 16. The requested size and frame count must fit the total pixel budget.
integer
default:200
GIF frame duration from 20 through 2,000 milliseconds, rounded to 10 milliseconds.
integer
default:100
JPEG or WebP compression level from 0 through 100. Ignored for PNG output.
string
default:"auto"
Moderation strictness: auto or low.
string
Optional stable, privacy-preserving identifier for the end user. Keep it at 128 characters or fewer.

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|null
The prompt after model-side revision, when returned.
string
Returned image format: png, jpeg, webp, or gif.
string
Quality level used for the result.
string
Resolved output dimensions as WIDTHxHEIGHT.
object
Token usage for the request and generated image.
integer
Input token count.
object
Breakdown of input tokens.
integer
Input text token count.
integer
Input image token count.
integer
Output image token count.
object
Breakdown of output tokens.
integer
Output text token count.
integer
Output image token count.
integer
Total input and output token count.

Request 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. GIF does not support compression.
  • For GIF output, 1024x1024 exceeds the total pixel budget at the default 9 frames, so use 1024x768.
  • complexity accepts low, medium, or high; if omitted, the model uses high.
  • GPT Image 2.6 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.