Budgets & Spend Control
Creating a BudgetEnterprise
Choosing a budget's scope, caps and period.
Budgets are created on the Budgets page, opened from Budgets in the top navigation, for the selected organization. New budget opens the form, with the Budget, Caps and Rules cards on the left and a live preview of the covered traffic on the right.
Steps
Creating a budget takes four steps:
- On the Budgets page, select New budget, and enter a Name of up to 120 characters, such as Production API.
- Choose the Scope, and add routers or tag rules for those scopes.
- Set the caps and the Period.
- Add rules, and select Create budget.
Scope
A budget has one scope:
| Scope | Covers | Lines |
|---|---|---|
| Org | Everything the organization sends, including requests that name a model with no router. | None. |
| Routers | Only the routers you list. | Up to 200 routers, each with its own cap. |
| Tag rules | Every router carrying a tag you list, including routers tagged later. | Up to 50 tags, each with a cap for each router. |
A request counts toward the router it was sent to: for a fallback or weighted router, that is the fallback or weighted router itself. A router that matches several tag rules counts once toward the total, and its own cap is the lowest among the rules. See Router Settings.
Caps
A budget holds up to three kinds of cap, all optional:
| Cap | Limits |
|---|---|
| Total cap | Spend across everything the budget covers. |
| Router or tag cap | Spend on each router, set on each line. |
| Model caps | Spend on one model, up to 50 models. On an Org budget, across the organization; on a Routers or Tag rules budget, on each router, inside its cap. |
A budget with lines and no total cap lets each line stand alone; a total cap below the sum of the lines makes the lines share it. A cap left empty means no cap. Model caps are catalog slugs, and on a Routers or Tag rules budget each model cap fits inside every per-router cap. New budgets start with the Routers scope.
Period
The period decides when spend resets, at 00:00 UTC:
| Period | Resets |
|---|---|
| Daily | Every day. |
| Weekly | Every Monday. |
| Monthly | On the 1st of each month. This is the default. |
| Lifetime | Never. |
Example
A team caps its production support bots at $5,000 a month in total, with no single router over $2,000, and keeps its most expensive model under $1,000. It creates a Tag rules budget for the tag production with a per-router cap of $2,000, a total cap of $5,000, the period Monthly, and a model cap of $1,000 on its most expensive model. A Notify rule at 80% of the total emails the team lead, and a Block rule at 100% of each router's cap stops a runaway router while the others keep serving.
Changing and deleting
Edit budget, the pencil on a budget's row, opens the same form, and Save changes applies the change at once. Turning off Enabled pauses the budget's tracking and blocking while keeping it. Delete budget, the trash icon on the row, removes the budget after a confirmation. Budgets managed by a policy change through the policy.