Skip to main content
POST
curl

Authorizations

Authorization
string
header
required

An account API key. Send it as Authorization: Bearer <key>.

Body

application/json

The request body of POST /v1/images/generations.

model
string
required

The model to generate with, named by its id or alias.

prompt
string
required

What to generate, in words. One to 8192 characters, and moderation screens it first.

quality
string | null

The provider's quality knob, passed through unchecked. A provider without one drops it.

size
string | null

The requested image size, written {width}x{height}; any other shape draws a refusal.

n
integer<int64> | null

How many images to ask for. Absent means one; a value above what the model declares draws a refusal.

response_format
enum<string>
default:url

Whether each image comes back as a link (url) or as inline base64 (b64_json).

Available options:
url,
b64_json

Response

The produced images. Each entry of data carries either a link the gateway hosts or the bytes inline, whichever response_format asked for. usage carries the count the charge was computed from.

The body both image routes answer with.

created
integer<int64>
required

When the gateway rendered this body, in seconds since the Unix epoch.

data
object[]
required

The produced images, in the order the provider returned them.

usage
object
required

What the gateway metered, filling in where the provider reported nothing.