Skip to main content
POST
Generate Images

Authorizations

Authorization
string
header
required

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

Body

application/json

Prompt and generation options.

prompt
string
required

A text description of the desired image(s).

model
string
required

The model to use for image generation.

background
string | null

Sets background transparency for generated images.

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 | null

A unique identifier representing your end-user.

Response

Generated images.

created
number
required

Unix timestamp when the image was generated.

data
object[]
required

Generated images.