[budget]
Spending limits per period and what Prism does when a threshold is reached.
| Key | Type | Default | Description |
|---|---|---|---|
[[budget.limits]] |
array of tables | limits are the spending limits, each for one period and optionally one app. |
|
budget.limits[].app |
string | app scopes the limit to one X-Prism-app; empty is global. |
|
budget.limits[].app_provenance |
string | app_provenance says what app names: “declared” (the default) for a name clients send in X-Prism-app, “observed” for the key of an application Prism recognized from traffic. |
|
budget.limits[].user |
string | user scopes the limit to one person’s requests: “owner” for the installation owner, or a user ID; empty counts everyone. |
|
budget.limits[].period |
string | hourly | daily | weekly | monthly | |
budget.limits[].usd |
number | usd is the spending limit for one period, in US dollars. |
|
budget.limits[].reset_at |
integer | daily: hour UTC, weekly: 1-7 (Mon-Sun), monthly: 1-28 | |
[[budget.limits[].thresholds]] |
array of tables | thresholds are the actions taken at given percentages of usd. |
|
budget.limits[].thresholds[].at_percent |
number | at_percent is the share of usd, in percent, at which the action starts. |
|
budget.limits[].thresholds[].action |
string | action is warn (add a warning header), downgrade (route as cheap), local_only (local models only) or reject (answer 429 budget_exceeded). |
|
[[budget.account_limits]] |
array of tables | account_limits cap one provider account’s spend; a spent account takes no traffic until its window resets. |
|
budget.account_limits[].route |
string | route is the account: an API-key provider name, or the route of a further account of that provider. |
|
budget.account_limits[].period |
string | period is hourly, daily, weekly or monthly, counted in UTC. |
|
budget.account_limits[].usd |
number | usd is the account’s spending limit for one period, in US dollars. |
|
budget.account_limits[].reset_at |
integer | reset_at is when the period starts: daily: hour UTC, weekly: 1-7 (Mon-Sun), monthly: 1-28. |
|
[[budget.model_limits]] |
array of tables | model_limits cap one model’s spend across its sellers; auto replaces a spent model by model_fallback, a request naming it is refused. |
|
budget.model_limits[].model |
string | model is the model id; every seller’s spelling of it counts. |
|
budget.model_limits[].period |
string | period is hourly, daily, weekly or monthly, counted in UTC. |
|
budget.model_limits[].usd |
number | usd is the model’s spending limit for one period, in US dollars. |
|
budget.model_limits[].reset_at |
integer | reset_at is when the period starts: daily: hour UTC, weekly: 1-7 (Mon-Sun), monthly: 1-28. |
|
budget.model_fallback |
string | model_fallback is how auto replaces a model whose budget is spent: next_cheaper (the default), cheapest_same_tier or model. |
|
budget.model_fallback_model |
string | model_fallback_model is the replacement for model_fallback = “model”: provider::model or a model id. |