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. Describe the image to generate.

Required string length: 1 - 32000
model
string
required

Required. Use a model ID or available alias returned by Get Models.

Minimum string length: 1
Examples:

"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

Number of generated images. Allowed counts depend on the selected model.

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

Output quality. Supported values depend on the selected model.

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

Response format: url returns image URLs; b64_json returns Base64 image data.

Available options:
b64_json,
url
size
string

Output size as WIDTHxHEIGHT, or auto for the model default. Supported sizes depend on the selected model.

Pattern: ^(auto|[1-9][0-9]*x[1-9][0-9]*)$
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.