Create image generation
Generate images from text prompts with configurable size, quality, and output format
Models you can use
| Model ID | Notes |
|---|---|
gpt-image-2 | GPT Image 2 — flexible sizing and multiple output formats |
Snapshot versions (e.g.gpt-image-2-2026-04-21) are currently unavailable. Please usegpt-image-2.
Size options (gpt-image-2)
The size parameter defaults to auto and supports flexible dimensions:
- Maximum edge length:
3840px - Both width and height must be multiples of
16 - Aspect ratio (long side to short side) must not exceed
3:1 - Total pixel count between
655,360and8,294,400
1024x1024, 1536x1024 (landscape), 1024x1536 (portrait),
2048x2048, 2048x1152, 3840x2160, 2160x3840.
Custom sizes are also supported (e.g. 1024x768), as long as both dimensions
are multiples of 16 and satisfy the constraints above.
Streaming
Streaming is not currently supported. Thestream and partial_images
parameters are accepted but have no effect — the response is always
returned as a complete JSON payload.
Quality and format
quality: Quality tiers are not currently supported; all requests use theautolevel. The parameter is accepted but has no observable difference between levels.output_format:png(default) /jpeg/webpoutput_compression: applies tojpeg/webponly, range0–100
Authorizations
Body
Image generation request body.
Model ID to use for image generation. Pass gpt-image-2.
Snapshot versions (e.g. gpt-image-2-2026-04-21) are currently unavailable.
"gpt-image-2"
A text description of the desired image. For gpt-image-2,
the maximum length is 32,000 characters.
"A cute baby sea otter floating on a blue ocean"
The n parameter is not currently supported. Defaults to n=1,
returning one image per request. To generate multiple images,
call the endpoint in a loop.
1 <= x <= 1Size of the generated image. For gpt-image-2, defaults to auto
with flexible dimensions (max edge 3840px, both dimensions multiples
of 16, aspect ratio ≤ 3:1, total pixels 655,360–8,294,400).
Common presets: 1024x1024, 1536x1024, 1024x1536, 2048x2048,
2048x1152, 3840x2160, 2160x3840.
"1024x1024"
"1536x1024"
"auto"
Background setting for the generated image. For gpt-image-2,
defaults to auto; supports opaque or auto.
gpt-image-2 does not support transparent — passing it returns a 400 error.
opaque, transparent, auto Content moderation level. For gpt-image-2, defaults to auto
(standard); low applies a more permissive policy.
auto, low Quality tiers are not currently supported; all requests use the
auto level. The parameter is accepted but has no observable
difference between levels.
low, medium, high, auto Streaming is not currently supported. The parameter is accepted but has no effect — the response is always returned as a complete JSON payload.
Image style hint. Only supported by DALL·E 3.
For gpt-image-2, the parameter is accepted but has no effect.
Output format of the generated image. For gpt-image-2, defaults
to png; options: png, jpeg, webp. Only GPT Image models
support this parameter.
png, jpeg, webp Output compression quality (0–100). For gpt-image-2, applies
only when output_format is jpeg or webp.
0 <= x <= 100Number of intermediate partial frames when streaming (0–3). Depends on streaming support — since streaming is not currently available, this parameter has no effect.
0 <= x <= 3Format in which the generated image is returned. Defaults to
b64_json (Base64-encoded image data); set to url to receive
a temporary access URL (download or save promptly).
b64_json, url A unique identifier for your end user, useful for monitoring and abuse detection.