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-1.5
Example:

"gpt-image-1.5"

prompt
string
required

Text description of the desired image.

Example:

"A cute cat wearing a space suit floating in the galaxy"

n
integer
default:1

Number of images to generate.

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

1

size
enum<string>
default:auto

Output image size.

Available options:
1024x1024,
1536x1024,
1024x1536,
auto
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,
webp,
jpeg
Example:

"png"

background
enum<string>
default:opaque

Background setting. transparent for transparent background, opaque for opaque background.

Available options:
transparent,
opaque
Example:

"opaque"

moderation
enum<string>
default:auto

Content moderation level.

Available options:
auto,
low
Example:

"auto"

output_compression
integer

Compression level for jpeg and webp formats (0-100%).

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

80

Response

Images generated successfully.

data
object[]

Array of generated images.