Skip to main content
POST
Image generation

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

Required. To generate a text description of the image; GPT Image model has a maximum length of 32,000 characters, dall-e-2 has a maximum length of 1,000 characters, and dall-e-3 has a maximum length of 4,000 characters.

Required string length: 1 - 32000
model
enum<string>
required

Required. Image generation model. The gateway will not adopt OpenAI's dall-e-2 default value, and the model must be passed explicitly.

Available options:
gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08,
gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08,
gpt-image-2,
gpt-image-2-2026-04-21,
gpt-image-1.5,
gpt-image-1,
gpt-image-1-mini,
dall-e-2,
dall-e-3
background
enum<string> | null

Background settings, only supported by GPT Image model. When using transparent output_format must be png or webp.

Available options:
transparent,
opaque,
auto,
null
moderation
enum<string> | null

Content moderation level, only supported by the GPT Image model. auto is the default value.

Available options:
low,
auto,
null
n
integer | null

The number of images generated. dall-e-3 only supports 1.

Required range: 1 <= x <= 10
output_compression
integer | null

Image compression ratio (0–100), only supported by webp or jpeg output of GPT Image, default 100.

Required range: 0 <= x <= 100
output_format
enum<string> | null

Output image format, only supported by GPT Image model.

Available options:
png,
jpeg,
webp,
null
partial_images
integer | null

The number of intermediate images returned in the streaming response, only supported by the GPT Image model.

Required range: 0 <= x <= 3
quality
enum<string> | null

Image quality. GPT Image supports auto/low/medium/high; GPT Image 2.5 additionally supports xhigh/max; dall-e-3 supports standard/hd; dall-e-2 only supports standard.

Available options:
auto,
low,
medium,
high,
xhigh,
max,
standard,
hd,
null
response_format
enum<string>
default:b64_json

Only dall-e-2 and dall-e-3 support url or b64_json. The GPT Image model always returns Base64 and this upstream parameter is not supported.

Available options:
b64_json,
url
size
enum<string> | null

Image size. GPT Image 2/2.5 supports WIDTHxHEIGHT: width and height are multiples of 16, ratio 1:3~3:1, up to 3840x2160; other GPT Images use auto, 1024x1024, 1536x1024 or 1024x1536; supported by dall-e-2 256x256, 512x512, 1024x1024; dall-e-3 supports 1024x1024, 1792x1024, 1024x1792.

Available options:
auto,
256x256,
512x512,
1024x1024,
1536x1024,
1024x1536,
1792x1024,
1024x1792,
null
stream
boolean | null

Whether to use SSE streaming generation, only supported by GPT Image model, default false.

style
enum<string> | null

Generate style, only supported by dall-e-3.

Available options:
vivid,
natural,
null
user
string

The unique identifier of the end user, used for abuse monitoring and detection.

Response

200 - application/json
created
integer
required

Unix timestamp in seconds when the image was created.

data
object[]
required

Generate a list of results.

background
enum<string>

The actual background settings used.

Available options:
transparent,
opaque
output_format
enum<string>

Actual output image format.

Available options:
png,
webp,
jpeg
quality
enum<string>

Actual build quality.

Available options:
low,
medium,
high
size
string

The actual resulting image size.

usage
object

The token usage of the GPT Image model.