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 CREATIONA 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:
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:
Columns shown in the table, in this order:
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.
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.
Under Applies to, choose the Provider, Model and AI Agent the budget covers (see Choose which calls a budget applies to).
Under Limit, choose what the budget counts (Counted in: Spend (USD) or Tokens), enter the Limit and choose the Period (see Period and window).
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.
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).
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:
AN IDENTICAL BUDGET IS REFUSEDThe 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.
A budget applies to the calls that meet all of its conditions: Provider, Model and AI Agent. An empty field includes every value.
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.
The warnings about a model without a price appear in three places:
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.
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 |
|---|---|---|
| Monthly | Fixed | Starts over on the 1st of each month, at 00:00 UTC. |
| Monthly | Sliding | Always adds up the last 30 days. |
| Weekly | Fixed | Starts over every Monday, at 00:00 UTC. |
| Weekly | Sliding | Always 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.
The budget's Status has two values, and only you change it, with the Active switch of the form, on creation and on edit:
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.
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.
Click the View icon on the row you want to open the read-only detail screen, on the Budget info tab, with:
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.
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 COUNTERChanging 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.
In the list, click Delete on the budget's row and confirm in the dialog.
DELETION CANNOT BE UNDONEOnce deleted, the budget stops limiting spend and its counter is lost. The operation cannot be undone.
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 |
|---|---|
error | Always budget_exceeded for a budget. A Policies rate limit answers rate_limit_exceeded. |
ruleId | Identifier of the budget that blocked the call. |
ruleName | The Name of the budget that blocked the call. |
resetAt | Date 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
ruleNamereturns 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.
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.
The table below covers all the fields of the create and edit form.
Field | Type | Required | Rules |
|---|---|---|---|
| Name | Text | Yes | 1 to 255 characters. Appears in the 429 error returned to the caller of the gateway. |
| Provider | Multiple selection | No | Up to 100 values. Empty includes every provider. |
| Model | Multiple selection, accepts typed values | No | Up to 100 values, each up to 512 characters. Empty includes every model. |
| AI Agent | Multiple selection, accepts typed values | No | Up 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 in | Toggle buttons | Yes | Spend (USD) or Tokens. |
| Limit | Numeric | Yes | Greater 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. |
| Period | Select | Yes | Monthly, Weekly or Last N days. |
| Number of days | Numeric | Only in Last N days | A whole number from 1 to 90. |
| Window | Toggle buttons | Only in Monthly and Weekly | Fixed or Sliding. Does not exist in Last N days. |
| Monitor only | Switch | No | Off, 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. |
| Active | Switch | No | It sits in the Status section, on creation and on edit. On by default. Off, the budget is Inactive and neither counts nor blocks. |
| End date | Date | No | It 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. |
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 Budgets | budgets | Allows listing Budgets | ai-gateway.budgets.list |
| View Budget | budgets | Allows viewing a Budget | ai-gateway.budgets.view |
| Create and Update Budgets | budgets | Allows creating and editing Budgets, and checking which Budgets overlap some conditions | ai-gateway.budgets.create-update |
| Delete Budgets | budgets | Allows deleting Budgets | ai-gateway.budgets.delete |
| List AI Agents | ai-agents | Allows listing AI Agents | ai-gateway.ai-agents.list |
| List Model Costs | pricing | Allows listing the effective cost per provider and model | ai-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 |
|---|---|---|
| List | Budgets item in the sidebar menu; listing with table, filters and pagination | List Budgets |
| View | View icon on the row and the budget detail screen | List Budgets + View Budget |
| Create | Create budget button and the form | List Budgets + Create and Update Budgets |
| Edit | Edit button inside the budget detail | List Budgets + View Budget + Create and Update Budgets |
| Delete | Delete icon on the row | List 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 VIEWINGThe 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.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more