1. Home
  2. Documentation
  3. AI Gateway
  4. Budgets

Budgets

Set how much a slice of traffic can spend in a period, in dollars or tokens, and block or only monitor whatever goes over the limit.

The Budgets module, under Spend Management > Budgets, sets how much a slice of AI Gateway traffic can spend in a period. When a budget reaches its limit, the gateway blocks the new calls it applies to, or only records how many it would have blocked, depending on the action you choose.

Several budgets can apply to the same call, and all of them count its consumption. The first one to reach its limit blocks the call.

THE COUNTER STARTS AT CREATION

A budget's counter starts when the budget is created. The cost of a call counts when its response arrives. So a call that finishes after the budget is created counts in full, even if it started earlier; spend already recorded before the creation never counts.

See how to:

Listing

The Budgets page lists every budget of the tenant, with search, filters, sorting by column and pagination. A tenant can have up to 200 budgets. The Create budget button stays enabled at that number: the refusal happens when you save (see Create a budget).

Filters available above the table:

  • Search: searches by name, provider, model or AI Agent.
  • Limited by: shows only the budgets that limit a Provider, a Model or an AI Agent, or Any.
  • Status: Active, Inactive or Any status.

Columns shown in the table, in this order:

  • Budget: the budget's name.
  • Applies to: what the budget covers. With no conditions it shows All calls; with several, it shows the first values and how many more there are.
  • Usage: the consumption in the current period, the limit and the percentage, with a green bar from 0 to 79%, yellow from 80 to 99% and red from 100%. In Monitor only, above 100% the bar stays full. A budget that is Inactive, or whose End date has passed, shows only the limit, in gray and with no bar. When the budget cannot count any spend, the column shows Not counting with the limit (see models without a price). If the consumption cannot be read at that moment, it shows Not available; the budget keeps working, and create, edit and delete stay available.
  • Status: Active or Inactive (see Status and End date).
  • End date: the date the budget stops being in force, or None. A date that has passed appears with a warning icon, and the tooltip says the budget no longer counts calls.
  • At limit: the action when the limit is reached, Block or Monitor only.
  • Actions: View and Delete.

With no budgets, the screen invites you to create the first one, with the Create budget button shown only to those who have the create permission.

Create a budget

Step 1

In Budgets, click Create budget.

Step 2

Under Identification, enter the Name. Name the budget after whoever answers for the spend. The name appears in the error returned to the caller of the gateway when the budget blocks a call, so do not put sensitive data in it.

Step 3

Under Applies to, choose the Provider, Model and AI Agent the budget covers (see Choose which calls a budget applies to).

Step 4

Under Limit, choose what the budget counts (Counted in: Spend (USD) or Tokens), enter the Limit and choose the Period (see Period and window).

Step 5

Under When the limit is reached, with the Monitor only switch off the budget blocks new calls; on, it only records how many it would have blocked.

Step 6

Under Status, leave the Active switch on so the budget applies from now on, or turn it off to create the budget Inactive. Enter the End date if the budget has a date to end (see Status and End date).

Step 7

Click Create budget.

An empty required field is flagged on the field itself, and the form is not sent.

After you save, the screen shows notices as toasts, never at the top of the form:

  • Identical budget refused. The toast says: "<name of the active budget> is already active with the same Applies to, period and unit. Change this budget, or turn that one off first."
  • 200-budget limit. The toast says: "This tenant already has 200 budgets, the most it can have. Delete one you no longer use, or edit an existing budget."
  • Overlap. When other budgets that are Active and within their End date also apply to some of the calls of the budget you saved, the toast says: "Another budget also applies to some of these calls: <name>. The first one to reach its limit blocks the call." The budget is saved anyway, because overlapping budgets are allowed. With several, the toast lists the names.
AN IDENTICAL BUDGET IS REFUSED

The system refuses an Active budget that is identical to another Active budget: same conditions, same period, same window, same number of days (in Last N days) and same unit. The limit, the name and the action are not compared. For that reason, a Monitor only budget cannot repeat the conditions of an Active budget that blocks. The refusal applies when creating, editing and reactivating, and applies even when the other budget's End date has passed. To create a budget identical to another, set the existing one to Inactive first.

Choose which calls a budget applies to

A budget applies to the calls that meet all of its conditions: Provider, Model and AI Agent. An empty field includes every value.

  • In Model and AI Agent, besides picking from the list, you can type a value and press Enter. In AI Agent, this is useful, for example, for the client id of callers authenticated by your own authorization server. Each field accepts up to 100 values, each up to 512 characters.
  • A budget with Provider set to OpenAI also covers Custom providers, because the AI Gateway registers a Custom provider as OpenAI.

Choose the unit and understand models without a price

Under Counted in, Tokens adds up the tokens of the calls. Spend (USD) adds up their cost, calculated from the model's price in Model Pricing. A model without a price has no cost that can be calculated, so its calls do not enter the dollar total.

In a Spend (USD) budget, the models considered are those on the Model line or, when it is empty, the models of the LLM Providers registered in the tenant, filtered by the Provider line when it is filled in.

  • No model has a price. The budget counts nothing. The Usage column shows Not counting with the limit, and the budget's detail says that none of its models has a price.
  • Only some models have no price. The consumption keeps being counted with the others, and warnings flag the models without a price (see below).

The warnings about a model without a price appear in three places:

  • Budget detail: a warning names the models without a price, up to 3. From 4 on, it shows the count and a Show N models link that opens the list.
  • Form: a one-line warning right below Counted in.
  • List: a warning icon before the Usage value, with a tooltip.

In both cases, register the models' price in Model Pricing or count the budget in Tokens.

Without the List Model Costs permission, the Budgets screens show neither Not counting nor the warning about a model without a price. The dollar count is not affected, because the AI Gateway does it.

Period and window

The Period defines the interval over which the consumption is added up. All periods and windows are counted in UTC.

Period
Window
How it counts
MonthlyFixedStarts over on the 1st of each month, at 00:00 UTC.
MonthlySlidingAlways adds up the last 30 days.
WeeklyFixedStarts over every Monday, at 00:00 UTC.
WeeklySlidingAlways adds up the last 7 days.
Last N days(not applicable)Always adds up the last N days, with N from 1 to 90.

In Sliding and in Last N days, the budget adds up the consumption of each day still inside the window and never starts over from zero. After it reaches the limit, it lets calls through again at the first 00:00 UTC at which the sum of the days still inside the window falls below the limit.

Status and End date

The budget's Status has two values, and only you change it, with the Active switch of the form, on creation and on edit:

  • Active: the budget counts the consumption and, with the block action, blocks.
  • Inactive: the budget neither counts nor blocks.

When you reactivate a budget within the same window, it counts from that moment on, and what was already counted in the window stays valid.

The End date is optional and is a date in UTC, placed right below the Active switch. Turning the Active switch off disables the field. The budget stays in force until the end of that day, 23:59:59.999 UTC, inclusive. The budget is still checked at that last instant and can block the call. But the cost is counted only when the response arrives: a call that finishes after 00:00 UTC does not add to the budget. From 00:00 UTC of the next day, the budget stops counting and blocking, but the Status does not change: it stays Active.

  • Date in the past. The form accepts only today or a later date. A past date is accepted only if it is the one the budget already had saved: when you edit an ended budget, it is kept.
  • Ended budget. The form shows the Expired alert: "This budget ended on <date> and doesn't count or block any call. Choose a later end date or clear it to use it again." The detail shows the same alert, which ends with "To use it again, edit the end date." For the budget to count again, enter a future End date or clear the date.

Monitor only is an action of the budget, chosen under When the limit is reached, not a status. A Monitor only budget appears as Active.

View a budget's details

Click the View icon on the row you want to open the read-only detail screen, on the Budget info tab, with:

  • Consumption: the bar with the consumption and the percentage of the limit. In Monitor only, it also shows Calls that would have been blocked, the number of calls in the period that would have been blocked.
  • Limit: the Amount, the Period, the Next reset, the When the limit is reached (Block new requests or Monitor only, nothing is blocked) and the End date. Next reset shows only the day the consumption starts over from zero, for example "Nov 1, 2026", and None, the window rolls in Sliding windows and in Last N days.
  • Applies to: the budget's Provider, Model and AI Agent. What is empty appears as All.
  • Details: Created by, Created at, Last updated by and Last updated at.

When the budget is Inactive, or its End date has passed, the detail explains why it is not counting, and shows the Expired alert in the second case. A budget with no priced model shows Not counting (see models without a price).

The Edit button opens the edit form.

Edit a budget

In the budget's detail, click Edit. The form is the same as for creation, and the save button is Save changes. A change to Applies to affects only the calls made from now on.

SOME EDITS RESTART THE COUNTER

Changing Applies to, the Period, the Number of days, the Window or the unit (Counted in) restarts the counter from zero when you save. For example, switching Last 30 days to Last 60 days zeroes the count. The screen warns you before you save. Changing the Name, the Limit, the action, the End date or the Status keeps the counter and the consumption shown.

Delete a budget

In the list, click Delete on the budget's row and confirm in the dialog.

DELETION CANNOT BE UNDONE

Once deleted, the budget stops limiting spend and its counter is lost. The operation cannot be undone.

Understand blocking

A budget with the block action stops the new calls it applies to when the consumption in the period reaches the limit. The caller of the gateway receives the 429 status and a JSON body that identifies the budget:

Field
Description
errorAlways budget_exceeded for a budget. A Policies rate limit answers rate_limit_exceeded.
ruleIdIdentifier of the budget that blocked the call.
ruleNameThe Name of the budget that blocked the call.
resetAtDate and time (UTC, RFC 3339 format) at which the budget lets calls through again. In a Fixed window, it is the start of the next period. In a Sliding window and in Last N days, it is the first 00:00 UTC at which the consumption of the days still inside the window falls below the limit, if nothing more is spent until then. In every window, resetAt never goes past the End date: if it comes first, resetAt is the end of the End date (00:00 UTC of the next day), when the budget stops applying. The Retry-After header carries the same moment.
THE BUDGET NAME IS VISIBLE TO THE CALLER

ruleName returns the budget's Name to the caller of the gateway. Do not put sensitive data in the name.

For example, a Last 7 days budget with a limit of 100 dollars spent 60 on February 2 and 50 on February 3, and blocks the calls of February 4. The consumption of February 2 leaves the window at 00:00 UTC on February 9, which leaves 50, below the limit. So resetAt is 2026-02-09T00:00:00Z.

When more than one rule, among budgets and rate limits, is at its limit, the body reports the rule whose resetAt is the latest. A blocked call does not reach the provider and consumes nothing.

The gateway checks the limit before the call and only records the cost after the response. For that reason, a budget can end above 100%, and by more when several calls happen at the same time: all of them pass the check before any cost is recorded. The next call is refused.

With the Monitor only action, the gateway lets the calls through and only counts how many it would have blocked. That number appears in the budget's detail.

Audit Log record

Creating, editing or deleting a budget generates a record in the Access Control Audit Log, with the date, the author and the result of the operation. Listing and opening the detail do not generate a record. You can find the record by filtering by Budget.

Form fields

The table below covers all the fields of the create and edit form.

Field
Type
Required
Rules
NameTextYes1 to 255 characters. Appears in the 429 error returned to the caller of the gateway.
ProviderMultiple selectionNoUp to 100 values. Empty includes every provider.
ModelMultiple selection, accepts typed valuesNoUp to 100 values, each up to 512 characters. Empty includes every model.
AI AgentMultiple selection, accepts typed valuesNoUp to 100 values, each up to 512 characters. Also accepts the client id of callers authenticated by your own authorization server. Empty includes all.
Counted inToggle buttonsYesSpend (USD) or Tokens.
LimitNumericYesGreater than zero, with up to 6 decimal places. In Spend (USD), at most 9,000,000,000. In Tokens, a whole number, at most 99,999,999,999,999.
PeriodSelectYesMonthly, Weekly or Last N days.
Number of daysNumericOnly in Last N daysA whole number from 1 to 90.
WindowToggle buttonsOnly in Monthly and WeeklyFixed or Sliding. Does not exist in Last N days.
Monitor onlySwitchNoOff, the budget blocks new calls; on, it only records how many it would have blocked. It sits in the When the limit is reached section.
ActiveSwitchNoIt sits in the Status section, on creation and on edit. On by default. Off, the budget is Inactive and neither counts nor blocks.
End dateDateNoIt sits in the Status section, below the Active switch, and is disabled while the budget is Inactive. In UTC. The budget stays in force until 23:59:59.999 UTC of that day. Accepts today or a later date, and the past date the budget already had.

Permissions

Access to each action in the Budgets journey depends on its own permission. Without the corresponding permission, the screen element does not appear: the interface never shows an unavailable action as disabled.

Permissions are granted in Access Control, on the Roles screen, under the AI Gateway product. The table below lists each one exactly as Access Control displays it.

Permission
Group in AC
Description in AC
Identifier
List BudgetsbudgetsAllows listing Budgetsai-gateway.budgets.list
View BudgetbudgetsAllows viewing a Budgetai-gateway.budgets.view
Create and Update BudgetsbudgetsAllows creating and editing Budgets, and checking which Budgets overlap some conditionsai-gateway.budgets.create-update
Delete BudgetsbudgetsAllows deleting Budgetsai-gateway.budgets.delete
List AI Agentsai-agentsAllows listing AI Agentsai-gateway.ai-agents.list
List Model CostspricingAllows listing the effective cost per provider and modelai-gateway.pricing.list

The last two belong to other journeys and affect specific Budgets actions, described in the notes after the next table.

Action
What it unlocks
Required permissions
ListBudgets item in the sidebar menu; listing with table, filters and paginationList Budgets
ViewView icon on the row and the budget detail screenList Budgets + View Budget
CreateCreate budget button and the formList Budgets + Create and Update Budgets
EditEdit button inside the budget detailList Budgets + View Budget + Create and Update Budgets
DeleteDelete icon on the rowList Budgets + Delete Budgets

Create and Edit: List AI Agents is what feeds the suggestions of the form's AI Agent field and the Manage AI agents link.

Create and Edit: List Model Costs is what feeds the suggestions of the form's Model field and the warning about a model without a price.

List and View: List AI Agents brings the agent name to the Applies to column of the list and to the budget detail. List Model Costs brings Not counting and the warnings about a model without a price (see models without a price). Without them, that information does not appear; the table, the filters and the consumption count remain available.

By default, the Super Admin and Admin roles receive all four Budgets permissions, and the Read-Only role receives List Budgets and View Budget.

A control without its permission is not rendered; a route reached directly by URL without its permission lands on the AI Gateway's own access denied screen, not on Access Control's.

EDITING REQUIRES VIEWING

The Edit button only exists inside the budget detail. Because of that, a user holding Create and Update Budgets but not View Budget has no path to edit an existing budget. This is expected platform behavior, not a bug.

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more