Skip to main content
POST
Generate an image

Authorizations

Authorization
string
header
required

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

Body

application/json
model
enum<string>
required

model ID

Available options:
gpt-image-2
Example:

"gpt-image-2"

prompt
string
required

Image description text

Example:

"A sunset skyline of a futuristic city with flying cars"

n
integer
default:1

Number of images to generate, 1–10, default 1. Select the Direct group in the console.

Required range: 1 <= x <= 10
Example:

1

size
string
default:1024x1024

Output image size in {width}x{height} format. Flexible resolution is supported — each side must be a multiple of 16, aspect ratio ≤ 3:1, total pixels 655,360–8,294,400, max side 3,840px.

Example:

"1024x1024"

quality
enum<string>
default:medium

Image quality

Available options:
low,
medium,
high
Example:

"high"

output_format
enum<string>
default:png

Output image format

Available options:
png,
jpeg
Example:

"png"

moderation
enum<string>
default:auto

Content moderation level

Available options:
auto,
low
Example:

"auto"

output_compression
integer

Compression level for jpeg (0-100%)

Required range: 0 <= x <= 100
Example:

80

Response

Image generated successfully.

data
object[]

Array of generated images