Skip to main content
POST
Generate Images

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

Text description of the desired image.

Example:

"A futuristic city skyline at sunset with flying cars"

n
integer
default:1

Number of images to generate. Supports 1–10. Default: 1. Requires selecting 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. Supports flexible resolutions — both edges must be multiples of 16, aspect ratio ≤ 3:1, total pixels between 655,360 and 8,294,400, max edge 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 format (0-100%).

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

80

Response

Images generated successfully.

data
object[]

Array of generated images.