POST
/
images
/
generations
Generate images from a prompt
curl --request POST \
  --url https://{controlPlaneURL}/api/llm/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "<string>",
  "background": "<string>",
  "model": "<string>",
  "moderation": "<string>",
  "n": 1,
  "output_compression": 123,
  "output_format": "<string>",
  "partial_images": 0,
  "quality": "<string>",
  "response_format": "url",
  "size": "<string>",
  "stream": false,
  "style": "<string>",
  "user": "<string>"
}'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json
prompt
string
required

A text description of the desired image(s).

background
string | null

Allows to set transparency for the background of the generated image(s)

model
string

The model to use for image generation.

moderation
string | null

Control the content-moderation level for images generated.

n
integer | null
default:1

The number of images to generate. Must be between 1 and 10.

output_compression
integer | null

The compression level (0-100%) for the generated images.

output_format
string | null

The format in which the generated images are returned.

partial_images
integer | null
default:0

The number of partial images to generate. Used for streaming responses.

quality
string | null

The quality of the image that will be generated.

response_format
string | null
default:url

The format in which generated images are returned. Must be one of url or b64_json.

size
string | null

The size of the generated images.

stream
boolean | null
default:false

Generate the image in streaming mode.

style
string | null

The style of the generated images.

user
string

A unique identifier representing your end-user.

Response

Successfully generated images

created
number
required
data
object[]
required