Skip to main content
POST
Generate image

Authorizations

Authorization
string
header
required

Workspace-scoped Dench API key from workspace settings. This is the same key used by DENCH_API_KEY in sandboxes.

Body

application/json
prompt
string
required

Image prompt.

Required string length: 1 - 32000
size
string

e.g. 1024x1024, 1536x1024, auto.

quality
enum<string>
Available options:
auto,
low,
medium,
high
format
enum<string>
Available options:
png,
jpeg,
webp
output_compression
integer
Required range: 0 <= x <= 100
background
enum<string>
Available options:
auto,
opaque,
transparent
savePath
string

Workspace path to write the image.

Response

Successful response

Gateway image envelope wrapping the OpenAI image result.

ok
boolean
required
model
string
required
endpoint
enum<string>
required
Available options:
generations,
edits
prompt
string
required
b64_json
string
required

Base64-encoded image bytes.

path
string
required

Workspace path where the image was saved.

signedUrl
string | null
required
revisedPrompt
string
quality
string
requestedSize
string
format
string
mimeType
string
estimatedCostUsd
number
storageId
string
contentHash
string
sizeBytes
number
usage
object
{key}
any