Estimate cost

Prices a request without running it. Takes the same body as generate, validates it the same way, and charges nothing. With model: "auto" the figure is an upper bound, because the model is not chosen until the task runs.

POST/image/generate/estimate
AuthAPI keyorOAuth tokenHow to send it

Request body

modelstring
default "auto""alibaba/qwen-image-2.0""alibaba/qwen-image-2.0-pro""alibaba/qwen-image-2.1-pro""alibaba/qwen-image-3.0""alibaba/qwen-image-3.0-pro""bytedance/seedream-5.0-lite""bytedance/seedream-pro""bytedance/seedream-v5-flash"
promptstringrequired

Positive prompt.

e.g. "Cute Cat"≥ 1 characters≤ 8192 characters
negative_promptstring
≤ 8192 characters
magic_promptboolean
countinteger
default 1≥ 1≤ 20
sizeobject | string
"auto""square""portrait""landscape""portrait_tall""landscape_wide""1:1""2:3"
type"auto"required
inputs(string | object)[]
≤ 20 items
type"image"required
asstring
"auto""source""reference"
sourceobjectrequired
type"url"required
urlstringrequired
format: uri
ratingobject | boolean
true
mode"nsfw_sfw"
default "nsfw_sfw"
outputobject
formatstring
"png""jpg""webp"
generate_public_access_tokenboolean

Return a short-lived public access token as public_access_token, for polling this task from browser code without your API key. Defaults to false.

webhookobject
registeredboolean

Set to false to skip the webhooks registered on the account for this task. Custom webhooks in custom are still sent.

customobject[]
≥ 1 items≤ 5 items
urlstringrequired

Receives this task's events, unsigned. Use https and a public host, and put a secret token in the query string to verify deliveries: only scheme://host is ever shown back.

e.g. "https://example.com/hooks/mynth?token=your-secret-token"
destinationstring
e.g. "bunny-prod"≥ 1 characters≤ 64 characters
metadataobject

Response

Image generation request validated and cost estimated

dataobjectrequired
estimated_coststringrequired

Estimated cost in USD for the request. Nothing is generated or charged.

e.g. "0.03"
currency"usd"required
estimate_kindstringrequired

"exact" when the model is pinned; "upper_bound" for model: "auto", which reserves a flat per-image ceiling until a concrete model is selected.

"exact""upper_bound"

Errors

A failed call names what went wrong in code, with a sentence in message. The codes, which of them are worth retrying, and how to read a validation failure are on Errors.