Skip to main content
POST
/
v1
/
openai
/
images
/
generations
Openai Images Generations
curl --request POST \
  --url https://api.example.com/v1/openai/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "n": 1,
  "response_format": "b64_json",
  "size": "1024x1024",
  "user": "<string>",
  "quality": "<string>",
  "style": "<string>"
}
'
{
  "data": [
    {
      "b64_json": "<string>",
      "revised_prompt": "<string>",
      "url": "<string>"
    }
  ],
  "created": 123
}

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

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