Skip to main content
POST
Generate images

Authorizations

Authorization
string
header
required

Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.

Scopes

full_access
PersonalAccessTokenAuth
full_access
WorkspaceApiKeyAuth
full_access
WorkspaceApiKeyBearerAuth

Headers

Idempotency-Key
string

One key per operation, 1 to 128 characters. A retry with the same key and request within 24 hours returns the first response.

Example:

"7f3c9a2e-retry-1"

X-Active-Branch-Id
string

ID of the branch the editor shows. Used when branch_id is omitted, for users who work on protected-main branches.

Path Parameters

app_id
string
required

ID of the app to generate media for.

Body

application/json
prompt
string
required

required; image instructions

Required string length: 1 - 32000
Example:

"A flat logo of a fox"

dry_run
boolean
default:false

true returns a credit estimate without generating or charging; omit or false to generate

model
string | null

prefer "automatic", which selects a model that supports every requested control together

Maximum string length: 100
Example:

"automatic"

reference_image_urls
string[]

Public HTTPS image URLs, or this app's own files, that guide the output.

Maximum array length: 16
aspect_ratio
string | null

output proportions, such as 16:9

Maximum string length: 20
Example:

"16:9"

resolution
string | null

output pixel scale, such as 1K

Maximum string length: 20
size
string | null

OpenAI pixel size such as 1024x1024; prefer aspect_ratio and resolution

Maximum string length: 20
Example:

"1024x1024"

n
integer | null

output count

Required range: 1 <= x <= 4
quality
string | null

rendering quality

Maximum string length: 20
output_format
string | null

image file encoding

Maximum string length: 20
background
string | null

transparent or opaque output background

Maximum string length: 20

Response

The stored images, or an estimate for a dry run.

images
GeneratedImage · object[]
required
usage
MediaUsage · object
required