---
title: "Multiple budget windows"
url: "/docs/proxy/budget_windows"
canonical_url: "https://docs.litellm.ai/docs/proxy/budget_windows"
type: "docs"
last_updated: "2026-12-02"
summary: "Put several spend caps on one key, team, internal user or customer, such as $10 a day and $100 a month, each tracked and reset on its own schedule."
related:
  - "/docs/proxy/per_model_budgets"
  - "/docs/proxy/budget_reset_and_tz"
---
# Multiple budget windows

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt


Available in LiteLLM v1.83.10 and later.

`budget_limits` puts several spend caps on one object at the same time, each with its own period. A key with a `24h` window of $10 and a `30d` window of $100 can spend at most $10 in a day and $100 in a month, and LiteLLM rejects the next request as soon as either window is full. Each window keeps its own spend and resets on its own schedule, so the daily window opens again at midnight while the monthly window keeps counting.

Windows work on virtual keys and teams, and on internal users and Customer Management budgets (since LiteLLM v1.111.0). They sit next to the plain `max_budget` and `budget_duration` on the same object, which stay a separate cap that is checked as well. LiteLLM keeps each window's spend per object and window in the `LiteLLM_BudgetWindowSpend` table.

## How it works

```mermaid
flowchart LR
  accTitle: A daily window blocks a key while its monthly window still has room
  accDescr: A key has a 10 dollar daily window and a 100 dollar monthly window. On 14 January 2030 the daily window is full while the monthly window has used 43 dollars, so the next request is rejected. At midnight only the daily window resets, so on 15 January requests are allowed again and the monthly window still shows 43 dollars.
  JAN14["14 Jan 2030, 16:00<br/>daily: $10 of $10<br/>monthly: $43 of $100"] -->|"next request"| REJ["Rejected<br/>daily window is full"]
  JAN14 -->|"midnight: only the<br/>daily window resets"| JAN15["15 Jan 2030, 00:00<br/>daily: $0 of $10<br/>monthly: $43 of $100"]
  JAN15 -->|"next request"| OK["Allowed<br/>both windows have room"]
  classDef default fill:#ffffff,stroke:#9ca3af,color:#111827;
```

Before it calls the provider, LiteLLM reads the current spend of every window on the key, the key's team and, where the personal budget applies, its user, and rejects the request with a [`budget_exceeded` error](./budget_exceeded_errors.md) if any of them has reached its `max_budget`. A window's period follows the same calendar rules as `budget_duration`, described in [Budget reset times and timezones](./budget_reset_and_tz.md), so `24h` ends at midnight, `7d` on Monday and `30d` or `1mo` on the 1st of the month, all in `litellm_settings.timezone`. When the reset job finds a window whose `reset_at` has passed, it zeroes that window and moves its `reset_at` to the next boundary, and leaves the other windows alone.

## When to use it

Reach for windows when one period is too coarse. A monthly cap on its own lets a runaway agent loop or a leaked key burn the whole month in an afternoon, while a `24h` window under the `30d` cap stops it the same day and still leaves a normal month room. Rolling out a coding tool works the same way, with a daily guardrail on each developer's key under a monthly ceiling. A batch workload that runs in bursts can get an hourly window on its team on top of a weekly cap. For the customers of your own product, a Customer Management template can give every member a monthly allowance and an annual ceiling at once.

If one period is enough, set `max_budget` with `budget_duration` instead. To cap a single model rather than all spend, use [per-model budgets](./per_model_budgets.md), which take their own period per model. Team members cannot have windows, so cap a member with a [team member budget](./team_member_budgets.md) and put windows on the member's keys if you need more than one period.

## Supported scopes

| Scope | Supported | How to set it |
| --- | --- | --- |
| Whole proxy | No | `litellm_settings` takes one `max_budget` and one `budget_duration`. |
| Organization | No | LiteLLM rejects `budget_limits` on an organization, and a `budget_id` whose budget row has windows. |
| Team | Yes | `budget_limits` on `/team/new` or `/team/update`. There is no Admin UI field. |
| Team member | No | A member budget takes one `budget_duration`. Put windows on the member's keys instead. |
| Project | No | A project budget takes one `budget_duration`. |
| Virtual key | Yes | `budget_limits` on `/key/generate` or `/key/update`, or **Budget Windows** in the key form. |
| Internal user | Yes | `budget_limits` on `/user/new`, `/user/update` or `/user/bulk_update` (since LiteLLM v1.111.0). Checked only where the user's personal budget applies. |
| Customer | Yes | Customer Management only, through `budget.budget_limits` on customer organizations, teams, members and budget templates (since LiteLLM v1.111.0). Customers created with `/customer/new` cannot have windows. |
| Tag | No | A tag budget takes one `budget_duration`. |
| Model access group | No | A model access group's budget row cannot hold windows. |
| AI tool | No | Each tool budget has one `budget_duration` of `1d`, `7d` or `30d`. |
| Agent session | No | `max_budget_per_session` is one cap per session with no `budget_duration`. |

## How to use it

### Add windows to a key

Pass `budget_limits` as a list of `{budget_duration, max_budget}` objects. `budget_duration` takes any duration LiteLLM accepts for a budget, listed in [Choose a duration](./budget_reset_and_tz.md#duration-formats), and `max_budget` is a cap in USD of 0 or more. Each duration can appear only once in the list. LiteLLM rejects a repeated duration, a negative cap or a duration it cannot parse with a 422.

```bash
curl -X POST 'http://0.0.0.0:4000/key/generate' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "key_alias": "coding-assistant",
    "budget_limits": [
      {"budget_duration": "24h", "max_budget": 10},
      {"budget_duration": "30d", "max_budget": 100}
    ]
  }'
```

LiteLLM stores each window with two fields of its own, `reset_at` for when the current period ends and `window_start` for when it began. Send the same list to `/key/update` to add windows to an existing key. A non-admin who creates a key cannot give a window a `max_budget` above their own, and key owners can change their windows themselves only when [self-serve budget changes](./self_serve_budgets.md) allow it.

### Add windows in the Admin UI

Open **Virtual Keys**, select **Create New Key**, expand **Optional Settings** and find **Budget Windows**.

[Image: Budget Windows section in the key form]

Select **+ Add Budget Window** to add a row, choose the period from the dropdown and enter the spend cap.

[Image: A budget window row with a period and spend cap]

Add a second row with a different period, for example a monthly $100 cap on top of a daily $10 cap.

[Image: Two budget windows with different periods]

Each row shows when its window resets.

[Image: Reset schedule shown below each budget window]

The dropdown offers Hourly (`1h`), Daily (`24h`), Weekly (`7d`) and Monthly (`30d`). Use the API for any other duration. To change the windows on an existing key, open the key and edit its settings, where the same **Budget Windows** section appears.

### Add windows to a team or an internal user

Teams and internal users take the same `budget_limits` list through the API. A team's windows cap everything spent on requests scoped to the team.

```bash
curl -X POST 'http://0.0.0.0:4000/team/update' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "team_id": "research",
    "budget_limits": [
      {"budget_duration": "1h", "max_budget": 20},
      {"budget_duration": "7d", "max_budget": 500}
    ]
  }'
```

Team admins cannot change a team's windows, because `budget_limits` is not one of the fields that `team_admin_editable_team_fields` can grant. See [Choosing what team admins can edit](./access_control.md#choosing-what-team-admins-can-edit).

```bash
curl -X POST 'http://0.0.0.0:4000/user/update' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "user_id": "alice",
    "budget_limits": [
      {"budget_duration": "1h", "max_budget": 1},
      {"budget_duration": "1mo", "max_budget": 100}
    ]
  }'
```

A user's windows apply wherever the user's personal `max_budget` applies, which is keys with no team, and team keys too when `general_settings.apply_user_budget_to_team_keys` is on. See [Apply user budgets to team keys](./access_management/inheritance.md#apply-user-budget-to-team-keys).

### Add windows to a customer

Customer Management budgets take `budget_limits` inside their `budget` object, on a customer organization, team or member, or on a budget template that many members share. Each member on a template gets its own spend in every window. [A separate allowance for each member](./customer_management/track-customer-spend.md#a-separate-allowance-for-each-member) walks through a template with a monthly and an annual window.

### Change or remove windows

`budget_limits` on an update replaces the whole list. A window whose `budget_duration` is still in the new list keeps its current `reset_at` and the spend it has counted, so raising a cap does not restart the period. A new duration starts in its current period, and a duration you leave out is dropped. Send an empty list, `"budget_limits": []`, to remove every window. The object's `max_budget` and `budget_duration` stay as they were.

### Check window spend

`/key/info`, `/team/info` and `/user/info` return the stored `budget_limits` and a `budget_limits_usage` map with the current spend of each window, keyed by its duration. LiteLLM reads that spend from the same counter it enforces against.

```bash
curl 'http://0.0.0.0:4000/key/info?key=sk-...' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY"
```

```json
{
  "info": {
    "budget_limits": [
      {"budget_duration": "24h", "max_budget": 10.0, "reset_at": "2030-01-15T00:00:00+00:00", "window_start": "2030-01-14T00:00:00+00:00"},
      {"budget_duration": "30d", "max_budget": 100.0, "reset_at": "2030-02-01T00:00:00+00:00", "window_start": "2030-01-01T00:00:00+00:00"}
    ],
    "budget_limits_usage": {
      "24h": {"current_spend": 10.0},
      "30d": {"current_spend": 43.0}
    }
  }
}
```

## Limits

Windows and the plain `max_budget` are separate caps on the same object, and the first one to run out blocks it. LiteLLM does not compare windows with each other or with `max_budget`, so keep each shorter window's cap below the longer ones.

A full key, team or user window opens again on the first run of the reset job after its `reset_at`, which with default settings can be up to about 10 minutes after the boundary. Customer Management windows roll over on the first request after the boundary instead. See [Tune the reset job](./budget_reset_and_tz.md#reset-job).

A window added partway through its period can start with spend already in it, because LiteLLM counts the spend it recorded for the object since that period began, for example since midnight for a daily window.

`throttle_on_budget_exceeded` covers only a key's own `max_budget`, so a full window still rejects a throttled key. Budget alerts follow `max_budget` and `soft_budget`, so a key, team or user window that fills up sends no alert. See [Throttle over-budget keys](./budget_throttling.md) and [Budget alerts](./budget_alerts.md).

`/budget/new` accepts `budget_limits`, but a budget row with windows can only back Customer Management. LiteLLM rejects attaching it to a key, organization, project, tag, team member, model access group or a customer created with `/customer/new`, or naming it in `max_end_user_budget_id`.

`POST /key/{key}/reset_spend` also clears every window on the key, and restarts each one from that moment for one full duration. For a window of whole days, weeks or months the reset after that lands on the usual calendar boundary again, while an hourly or shorter window keeps counting from the new starting point.

The reset hints in the Admin UI key form assume midnight UTC. Windows really reset in `litellm_settings.timezone`, weekly and monthly ones at `budget_reset_time`, and a `7d` window resets on Monday even though the weekly hint says Sunday.

## Related

[Budget rollover](./budget_rollover.md) explains how overage above a key, team or user window carries into its next period, [Budget reset times and timezones](./budget_reset_and_tz.md) lists when each duration resets, and [Budgets and spend limits](./budgets.md#how-stacked-budgets-combine) covers how windows combine with every other budget a request falls under.

## Related pages

- [Per-model budgets](https://docs.litellm.ai/docs/proxy/per_model_budgets.md)
- [Budget reset times and timezones](https://docs.litellm.ai/docs/proxy/budget_reset_and_tz.md)
