Estimate output cost and budget impact
POST/v1/budget/estimate
Enterprise-only pre-flight check for one model request. Supply a model
and optional max_tokens; DVARA estimates the maximum output cost from
the model's configured output price, checks the tightest applicable
budget for the authenticated workspace and API key, and returns the
remaining budget without calling a provider or writing usage or cost.
pricing_known: false means no configured price matched the model.
In that case estimated_cost_usd is 0.0 and is not a reliable cost
forecast. would_exceed_budget is still true when the workspace or
key is already at or above its hard cap, even when pricing is unknown.
A nonempty API-key scope list must include completions:write. An
unscoped key remains unrestricted. This endpoint is not included in the
Open Source runtime.
Request
Responses
- 200
- 400
- 401
- 403
- 429
Cost estimate and current budget decision. Nullable remaining-budget fields mean no applicable budget is configured.
The required model field is missing or blank.
A key is required. Missing, invalid, revoked, or expired keys are refused.
The key is valid but its nonempty scope list does not include completions:write (api_key_scope).
Per-key rate limit reached, or priority admission control throttled the request (PRIORITY_THROTTLED).