Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer token authentication. Get your API key from the dashboard.

Body

application/json
model
string
required

The model to use for image generation

Example:

"gpt-image-1"

prompt
string
required

A text description of the desired image(s)

Maximum string length: 1000
Example:

"A cute baby sea otter"

n
integer
default:1

The number of images to generate

Required range: 1 <= x <= 10
size
enum<string>
default:1024x1024

The size of the generated images

Available options:
256x256,
512x512,
1024x1024,
1792x1024,
1024x1792
stream
boolean
default:false

If set, generation progress updates will be sent as server-sent events

response_format
enum<string>
default:url

The format in which the generated images are returned

Available options:
url,
b64_json

Response

Successful response

created
integer
required

The Unix timestamp (in seconds) of when the images were generated

data
object[]
required

Array of generated image objects