Skip to main content
POST
TypeScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for image generation

model
string
required

The model to use for image generation.

Example:

"black-forest-labs/FLUX.1-schnell"

prompt
string
required

A text description of the desired image(s). The maximum length is 1000 characters.

Example:

"A cute baby sea otter floating on its back"

n
integer<int32> | null

The number of images to generate. Defaults to 1.

Required range: x >= 0
Example:

1

quality
string | null

The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image.

Example:

"hd"

response_format
string | null

The format in which the generated images are returned.

Example:

"url"

size
string | null

The size of the generated images.

Example:

"1024x1024"

style
string | null

The style of the generated images.

Example:

"vivid"

user
string | null

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

Example:

"user-1234"

Response

Image generations

Response format for image generation

created
integer<int64>
required
Example:

1677649420

data
object[]
required