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

"gpt-image-1.5"

prompt
string
required

Image description text

Example:

"An adorable cat in a spacesuit floating in the Milky Way"

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 a transparent background, opaque for an 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 (0-100%)

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

80

Response

Image generated successfully.

data
object[]

Array of generated images