Skip to main content
POST
Generate an image
See the Images guide for runnable examples, edit / image-to-image, and model discovery.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

application/json
model
string
required
prompt
string
required
aspect_ratio
string
async
boolean

Run generation on the background worker and return a job to poll (202) instead of waiting inline (200). Use for slow models. Single-image only.

image
string
mask
string
n
integer
parameters
object
quality
string
reference_images
string[]
response_format
string
size
string
store
boolean

Persist each generated image to /v3/files and return a reusable file_id per image. Defaults to true; set false to skip.

Response

Successful response

created
integer
required
data
object[]
required
id
string
required
model
string
required
usage
object
required