Skip to main content
POST
Openai Images Generations

Authorizations

Authorization
string
header
required

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

Headers

xi-api-key
string | null
x-api-key
string | null

Body

application/json
model
string
required

The model to use for image generation.

Example:

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

prompt
string
required

A text description of desired image(s).

Example:

"A photo of an astronaut riding a horse on Mars."

n
integer
default:1

The number of images to generate.

Required range: 1 <= x <= 4
response_format
enum<string> | null
default:b64_json

The format in which the generated images are returned. Currently only b64_json is supported.

Available options:
b64_json
size
string
default:1024x1024

The size of the generated images. Available sizes depend on the model.

user
string | null

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

quality
string | null

The quality of the image that will be generated.

style
string | null

The style of the generated images.

Response

Successful Response

data
OpenAIImageData · object[]
required

List of generated images

created
integer

Unix timestamp of when the images were created