Estimate
Price a generation request and get its output size without submitting it or spending credits.
POST /v1/generation/estimate
Validates a request exactly as submit would and returns the price, the resolved model and the output dimensions. Nothing is created, held or charged.
Scope: generation:read
The body is the submit body plus capability. Input references are parsed but not looked up: asset ids aren’t checked, URLs aren’t fetched and data URIs aren’t stored, so an estimate doesn’t confirm that your inputs are usable. An estimate also doesn’t run content moderation, so a prompt can price fine and still be blocked at submit.
Body
The capability to price, for example image.generate. See Capabilities and models.
The model to price. Omit to use the capability’s first available model (z-image-turbo for image.generate).
Required (non-empty) when the capability has prompt_required: true, same as on submit.
Slot name to a list of inputs: asset ids, asset URLs, https:// URLs or data: URIs. Slot counts are checked against the model’s limits.
A resolution tier the model accepts. Defaults to the model’s default_resolution.
One of 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, 4:5, 5:4. Defaults to 16:9 for video and 1:1 otherwise.
No model has quality tiers today; any value is rejected.
Clip length in seconds. Defaults to the model’s first duration; image models reject it.
Accepted and ignored for pricing.
Outputs per job, from 1 to the model’s max_outputs. credits is the one-output price times this.
png, jpeg or webp, checked as on submit. Doesn’t change the price.
1 to 100, jpeg and webp only. Doesn’t change the price.
A preset slug or slug@version. Its parameters are applied before pricing, so the estimate reflects the model and tier the preset would pick.
Accepted and ignored.
The project to act in. Defaults to the X-Windpaint-Project header, then your organization’s default project.
Response
201 Created with {"data": Estimate}.
The capability priced.
The model that would run, after defaulting.
The price in credits, as a decimal string: unit_credits times num_outputs. This is the credits_estimate a submit would hold. null when the tier has no price, in which case the request can’t be submitted.
The price of one output at this tier.
The number of outputs priced.
The output format that would be used, for example png. null for models without selectable formats, such as video models.
Output width in pixels. null for outputs without pixel dimensions.
Output height in pixels. Both edges are rounded to multiples of 16.
true when the model is serving and the tier has a price. When false, a submit returns 503.
Errors
| Status | When |
|---|---|
422 | Unknown capability or model, a model that doesn’t implement the capability, wrong slot counts, an unsupported resolution, aspect_ratio, quality or duration, a bad num_outputs, output_format, output_quality or preset, a missing prompt, or an input that isn’t a valid reference. Same messages as submit. |
An estimate never returns 402; it doesn’t check your balance.