---
title: "Budgets and spend limits"
url: "/docs/proxy/budgets"
canonical_url: "https://docs.litellm.ai/docs/proxy/budgets"
type: "docs"
last_updated: "2026-12-02"
summary: "Set spend caps on keys, users, teams, organizations, projects, customers, tags and model access groups, and control what happens when one is reached."
related:
  - "/docs/proxy/token_redaction_spend_logs"
  - "/docs/proxy/proxy_budget"
---
# Budgets and spend limits

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


A budget caps LiteLLM spend at one of these scopes:

- [Whole proxy](./proxy_budget.md): all spend through the proxy.
- [Organization](./organization_budgets.md): everything its teams and keys spend. A team's keys count toward the team's organization even when the key sets none.
- [Team](./team_budgets.md): everything spent on requests scoped to the team, across its keys, projects and members.
- [Team member](./team_member_budgets.md): what one person spends inside one team.
- [Project](./project_management.md): what the keys in one project spend. A project belongs to a team, so this spend also counts toward the team.
- [Virtual key](./key_budgets.md): what one LiteLLM API key spends.
- [Internal user](./internal_user_budgets.md): what one person spends on requests outside a team, and on team requests too when `apply_user_budget_to_team_keys` is on.
- [Customer](#customer-budgets): what one customer of your application spends, identified by the `user` field or a customer header, across every key that sends their ID.
- [Tag](./tag_budgets.md): what every request carrying the tag spends, across all keys and teams.
- [Model access group](./model_access_group_budgets.md): what requests to the models in the group spend, across all callers.
- [AI tool](./ai_tool_budgets.md): what one coding tool, such as Claude Code or Cursor, spends inside a team or for one of its members.
- [Agent session](../a2a_iteration_budgets.md): what one session of an agent spends, capped by the agent's `max_budget_per_session`.

[Per-model budgets](./per_model_budgets.md) can narrow a key, internal user, team, team member or customer budget to a single model. Budgets are in USD, and an optional `budget_duration` such as `1d`, `30d` or `1mo` resets spend on a schedule.

LiteLLM checks every budget a request falls under before it calls the provider, and rejects the request once any of them has run out, until that budget resets or you raise it. Budgets are optional, and a scope without one has no spend limit. [Budget precedence](./access_management/inheritance.md#budgets) lists which budgets apply to each kind of request, and [Identities](./multi_tenant_architecture.md#identities) explains how these scopes relate.

Everything on this page limits callers. [Budget routing](./provider_budget_routing.md) is a separate feature: it routes traffic away from providers, deployments or tags that have used up their own budget. [Rate limits](./rate_limits.md) cap tokens and requests per minute and are set separately from budgets.

To create, view or delete the keys themselves, see [Virtual keys](./virtual_keys.md). The API examples on this page use a proxy at `http://0.0.0.0:4000` and an admin key in `LITELLM_MASTER_KEY`.

## How budgets work {#how-budgets-work}

### Where each budget is set

| Scope | Where the budget is set |
| --- | --- |
| Whole proxy | `max_budget` and `budget_duration` under `litellm_settings` |
| Organization | `/organization/new` or `/organization/update` |
| Team | `/team/new` or `/team/update` |
| Team member | `team_member_budget` on the team, or `max_budget_in_team` for one member |
| Project | `/project/new` or `/project/update` |
| Virtual key | `/key/generate` or `/key/update` |
| Internal user | `/user/new` or `/user/update` |
| Customer | Customer Management, or `/customer/new` for legacy end users |
| Tag | `/tag/new` or `/tag/update` |
| Model access group | `PUT /access_group/{access_group}/budget` |
| AI tool | `PUT /team/{team_id}/ai_tool_budgets` |
| Agent session | `max_budget_per_session` in the agent's `litellm_params` |

### Shared budgets and inline fields

Teams, internal users and keys keep `max_budget`, `budget_duration` and related fields on their own record. Organizations, projects, customers, tags, model access groups and team memberships store their limits in a budget row referenced by `budget_id`. A row made with `/budget/new` can back many objects at once, such as a pricing tier that many customers share, while each object counts its own spend. See [Shared budgets](./shared_budgets.md).

### Budgets need a database

Proxy, organization, team, team member, key and user budgets are enforced against spend read from the database, so none of them caps anything on a [deployment without a database](./docker_quick_start.md#running-without-a-database). See [Whole proxy budget](./proxy_budget.md) for how the proxy-wide cap behaves there.

### How stacked budgets combine

LiteLLM checks every budget a request falls under, and any scope that is over its cap rejects the request, so the strictest active cap wins. Raising one cap never lifts another: a member whose allowance goes from $120 to $240 is still blocked once the team's shared budget runs out. [Access inheritance](./access_management/inheritance.md#budgets) lists which caps apply to each kind of request, in the [budget scope matrix](./access_management/inheritance.md#budget-scope-matrix).

### Default budgets {#default-budgets}

Settings under `litellm_settings` give new internal users, teams, keys and customers a budget when the request that creates them sets none, such as `max_internal_user_budget`, `default_team_params`, `default_key_generate_params` and `max_end_user_budget_id`, and a team's own `team_member_budget` does the same for its members. Which one applies depends on how the object is created, for example `/user/new`, SSO sign-in or JWT `user_id_upsert`. Organizations, projects, tags and model access groups have no default. See [Default budgets](./default_budgets.md).

## Budget management features {#budget-management-features}

These features change how a budget is set, counted, reset or enforced. Each has its own page with a table of the scopes it supports.

| Feature | Use it to |
| --- | --- |
| [Shared budgets](./shared_budgets.md) | Back many customers, keys, tags or organizations with one budget row, such as a pricing tier. |
| [Default budgets](./default_budgets.md) | Give new users, teams, keys and customers a budget automatically. |
| [Per-model budgets](./per_model_budgets.md) | Cap spend on individual models under a scope's overall budget. |
| [Multiple budget windows](./budget_windows.md) | Enforce several caps at once, such as $10 a day and $100 a month. |
| [Budget reset times and timezones](./budget_reset_and_tz.md) | Align resets to calendar days, weeks and months in your timezone. |
| [Budget rollover](./budget_rollover.md) | Carry overspend, or unused budget, into the next period. |
| [Soft budgets and budget alerts](./budget_alerts.md) | Warn owners by Slack, webhook or email before or when a budget runs out. |
| [Team soft budget alerts](./ui_team_soft_budget_alerts.md) | Email chosen recipients when a team crosses a fixed-dollar soft budget. |
| [Budget exceeded errors](./budget_exceeded_errors.md) | Understand and change what callers get when a budget runs out. |
| [Throttle over-budget keys](./budget_throttling.md) | Slow an over-budget key down instead of stopping it. |
| [Budget fallbacks](./budget_fallbacks.md) | Reroute to another model when a key's per-model budget runs out. |
| [Temporary budget increase](./temporary_budget_increase.md) | Raise a key's or team member's budget until an expiry time. |
| [Budget reservation](./budget_reservation.md) | Hold each request's estimated cost against its budgets so a burst of concurrent requests cannot overshoot. |
| [Fail-closed budget enforcement](./fail_closed_budgets.md) | Reject requests whose spend cannot be verified during a Redis or database outage. |
| [Free models and budgets](./free_model_budgets.md) | Keep zero-cost models usable after a budget runs out. |
| [Self-serve budget changes](./self_serve_budgets.md) | Let key owners change their own key budgets within limits. |

## When a budget is exceeded {#when-a-budget-is-exceeded}

A request that runs into an exhausted budget fails before LiteLLM calls the provider. The settings below change the response, let an over-budget key slow down instead of stopping, decide what happens when spend cannot be read, and control what carries over at reset.

### Response code

Over-budget requests fail with error type `budget_exceeded` and status 422 by default, and `litellm_settings.budget_exceeded_status_code` changes the status. Agent session budgets and tag budgets in config fail differently. See [Budget exceeded errors](./budget_exceeded_errors.md).

### Throttle instead of block

A key with `throttle_on_budget_exceeded: true` keeps serving past its own `max_budget` at `litellm_settings.budget_exceeded_throttle_percentage` of its TPM and RPM limits. See [Throttle over-budget keys](./budget_throttling.md).

### Fail-closed vs fail-open

`general_settings.fail_closed_budget_enforcement: true` rejects budgeted requests with a 503 when their spend cannot be verified, instead of admitting them. See [Fail-closed budget enforcement](./fail_closed_budgets.md).

### Reroute on model breach

When a key's per-model cap is reached, `budget_fallbacks` on the key reroutes the request down a chain of other models instead of rejecting it. See [Budget fallbacks](./budget_fallbacks.md).

### Rollover at reset

`litellm_settings.budget_rollover: true` carries overspend into the next period, and `rollover_max_budget` carries a user's or team member's unused budget forward as credit. See [Budget rollover](./budget_rollover.md).

## Spend alerts {#spend-alerts}

A `soft_budget` never blocks a request and sends an alert when spend crosses it. Max budget alerts go out by Slack, webhook or email as spend nears and crosses `max_budget`, with email thresholds set as percentages per key, team or team member, and each alert repeats at most once a day by default. Which scopes alert, and through which channel, differs by scope. See [Soft budgets and budget alerts](./budget_alerts.md) and [Team soft budget alerts](./ui_team_soft_budget_alerts.md). Customer Management sends its own [budget webhooks](./customer_management/track-customer-spend.md#1-set-up-budget-webhooks).

## Roles and permissions {#roles-and-permissions}

### Admins

Proxy admins can set and change every budget. Team admins can change the budgets of keys in their team, and need `member_key_budgets` in `general_settings.team_admin_editable_team_fields` to change a key another member owns. They change team settings only where a proxy admin lists the field in `general_settings.team_admin_editable_team_fields`: with `max_budget` listed they can keep or lower the team's budget, adding `raise_max_budget` lets them raise it up to the organization's cap, and they can never remove it. See [Self-serve budget changes](./self_serve_budgets.md#admin-rules-for-key-budgets) and [Choosing what team admins can edit](./access_control.md#choosing-what-team-admins-can-edit).

### Self-serve by key owners

`general_settings.self_serve_budget_policy` lets the person who created a key, and still owns it, lower or within limits raise its budget without an admin. See [Self-serve budget changes](./self_serve_budgets.md).

### Personal budgets on team keys

A team-scoped key is governed by the team and team member budgets, and the owner's personal `max_budget` does not apply by default. Set `general_settings.apply_user_budget_to_team_keys: true` to enforce it as well. See [Apply user budgets to team keys](./access_management/inheritance.md#apply-user-budget-to-team-keys).

### Team member permissions

`team_member_permissions` on a team lists the routes its members may call for that team, for example `/key/update` to edit the team's keys, or `/team/daily/activity` and `/spend/logs` to see the whole team's usage. Budget edits through `/key/update` still follow the rules above. See [Team member permissions](./access_control.md#team-member-permissions).

## Audit budget changes {#budget-changes}

With audit logging on, LiteLLM records each create, update and delete of a key, team or internal user, including budget edits, with the values before and after the change, who made it and the API key used. Changes made through `/budget/*` or the organization, project, tag and customer endpoints are not recorded. Audit logging is on by default with an Enterprise license, and `litellm_settings.store_audit_logs` turns it on or off explicitly.

To record the person behind a change that an automation key makes, send a `litellm-changed-by` header. LiteLLM uses it as `changed_by` only when the calling key or its team has `metadata.allow_litellm_changed_by_header: true`; otherwise it records the caller's user ID. See [Audit logs](./audit_logs.md) and [Attribute management changes to users](./audit_logs.md#attribute-management-changes-to-users).

## Organization, team, and project budgets {#container-budgets}

Organizations contain teams, teams contain projects, and keys can belong to any of them. Spend from every key under a container counts toward its budget. A team's `max_budget` cannot exceed its organization's when you set it, but LiteLLM does not add up team budgets; the organization's cap is checked separately on each request. See [Organization](./organization_budgets.md) for the full walkthrough, including the Admin UI steps.

> **LiteLLM Enterprise feature: An organization or project budget.** Requires an Enterprise license (`LITELLM_LICENSE`). Talk to sales: https://www.litellm.ai/enterprise#talk-to-sales

### Set a container budget

Pass `max_budget`, `budget_duration` and optionally `soft_budget` to `/team/new`, `/organization/new` or `/project/new`. A `soft_budget` alerts only for teams and projects; see [Soft budgets and budget alerts](./budget_alerts.md). Organizations and projects also accept a `budget_id` that links a [shared budget](./shared_budgets.md). A team can set `team_member_budget` as each member's default allowance at the same time. With Terraform, use the `litellm_team`, `litellm_organization`, `litellm_project` and `litellm_budget` resources; see [Terraform](./configuration/terraform.md).

```bash
curl -X POST 'http://0.0.0.0:4000/team/new' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "team_alias": "research",
    "max_budget": 1000,
    "soft_budget": 800,
    "budget_duration": "1mo",
    "team_member_budget": 120,
    "team_member_budget_duration": "1mo"
  }'
```

### Check a container budget

`/team/info`, `/organization/info` and `/project/info` return the container's current `spend` alongside its budget fields.

### Change or remove a container budget

Send new values to `/team/update`, `/organization/update` or `/project/update`. Only a proxy admin, or an org admin for a team in their organization, can remove a team's cap with `max_budget: null`.

### Default team budgets

New teams that leave out `max_budget` or `budget_duration` take them from `litellm_settings.default_team_params`. Organizations and projects have no proxy-wide default. See [Default budgets](./default_budgets.md#teams).

## API key budgets {#key-budgets}

### Set a key budget at creation

`/key/generate` takes `max_budget`, `budget_duration` and `soft_budget`, or a `budget_id` that links a budget row; a key without its own `budget_duration` then follows that row's reset schedule. `budget_limits` sets several windows at once, such as a daily and a monthly cap; see [Multiple budget windows](./budget_windows.md). [Per-model budgets](./per_model_budgets.md) cap individual models.

```bash
curl -X POST 'http://0.0.0.0:4000/key/generate' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"max_budget": 100, "budget_duration": "30d", "soft_budget": 80}'
```

### Check a key budget and spend

`/key/info` returns the key's `spend` for the current window, `total_spend` across all windows, `model_spend` by model, and `budget_reset_at`.

### Add or change a key budget

Send the new values to `/key/update`. Who may change them is covered in [Roles and permissions](#roles-and-permissions).

### Temporary budget increases

`temp_budget_increase` and `temp_budget_expiry` on `/key/update` add to the key's `max_budget` until the expiry time, and both must be set together. See [Temporary budget increase](./temporary_budget_increase.md).

### Remove a key budget

Send `max_budget: null` to `/key/update`, and `budget_duration: null` to stop resets.

### API key default budgets

`litellm_settings.default_key_generate_params` fills in `max_budget` and `budget_duration` for new keys that leave them out, and `litellm_settings.upperbound_key_generate_params` caps the values `/key/generate` accepts. See [Default budgets](./default_budgets.md#keys).

## User budgets {#user-budgets}

A person can hold a budget in three places at once: their own account, each team they belong to, and each organization they belong to.

### Personal budget

`max_budget` and `budget_duration` on `/user/new` or `/user/update` cap the user's personal spend. It applies to keys with no team; team-scoped keys skip it unless `general_settings.apply_user_budget_to_team_keys` is true. `rollover_max_budget` lets unused budget carry forward; see [Budget rollover](./budget_rollover.md) and [Internal user](./internal_user_budgets.md).

### Budget inside a team

A team's `team_member_budget` and `team_member_budget_duration` give every member the same default allowance, and `max_budget_in_team` on `/team/member_add` or `/team/member_update` overrides it for one member. The team's own cap still applies to all members together. See [Team members](./team_member_budgets.md) and [Team member budget precedence](./access_management/inheritance.md#team-member-budget-precedence).

### Budget inside an organization

`/organization/member_update` accepts `max_budget_in_organization`, and LiteLLM tracks the member's spend in that organization. Requests are not rejected when that spend reaches it, so use a team member budget to enforce a per-person cap.

### Check and change a user budget

`/user/info` returns the user's spend and budget. Change a personal budget with `/user/update` or `/user/bulk_update`, and a team member's budget with `/team/member_update`.

### User default budgets

`max_internal_user_budget` and `internal_user_budget_duration` cover users created through the API, Admin UI or `lite login`, `default_internal_user_params` overrides them on those paths, and only `default_internal_user_params` covers JWT-provisioned users; see [Default budgets](./default_budgets.md#internal-users). A team's `team_member_budget` is the default inside that team. For tiered allowances without SCIM, see [Tiered SSO budgets](./identity_provisioning.md#tiered-sso-budgets).

## Customer budgets {#customer-budgets}

Customers are the people or accounts your application serves, separate from LiteLLM's internal users; see [Customers and end users](./multi_tenant_architecture.md#customers).

### Customer Management

Available in LiteLLM v1.111.0 and later.

Customer Management tracks customers as organizations, teams and members, identified by request headers. Each level takes its own budget, and member budget templates give every member a default allowance. Set them in the Admin UI or through `/management/v1/customer_organizations`, `/management/v1/customer_teams` and `/management/v1/customer_members`. See [Customer Management](./customers.md#customer-budgets) and [Set customer budgets and read usage](./customer_management/track-customer-spend.md).

### Legacy end users

Older integrations send the customer's ID in the `user` request field or in the `x-litellm-customer-id` or `x-litellm-end-user-id` header. Give that customer a budget with `/customer/new` or `/customer/update`, passing `max_budget` or a `budget_id` but not both. `/customer/info` returns its spend and `/customer/delete` removes the record. See [Setting customer budgets](./legacy_end_users.md#setting-customer-budgets).

### Default customer budget

A customer with no budget of its own uses the budget row named by the calling key's `end_user_budget_id`, otherwise `litellm_settings.max_end_user_budget_id`. A numeric `max_end_user_budget` is not enforced. See [Default budgets](./default_budgets.md#customers), [Customer budget resolution](./access_management/inheritance.md#customer-budget-resolution) and [Default budget for all customers](./legacy_end_users.md#default-budget-for-all-customers).

## Tag budgets {#tag-budgets}

### Tags in the database

Create a tag with `/tag/new`, passing `max_budget` and `budget_duration`, or a `budget_id`. Spend from requests that carry the tag, through the key's tags or the request's own tags, counts toward it, and requests are rejected once the tag is over its cap. `/tag/info`, `/tag/update` and `/tag/delete` read, change and remove it. See [Tag budgets](./tag_budgets.md).

### Tags in config

> **LiteLLM Enterprise feature: Defining tag budgets in config.** Requires an Enterprise license (`LITELLM_LICENSE`). Talk to sales: https://www.litellm.ai/enterprise#talk-to-sales

`litellm_settings.tag_budget_config` declares tag budgets in `config.yaml`, each with a `max_budget` and a `budget_duration`. The router's budget limiter enforces them, as described in [Budget routing](./provider_budget_routing.md#tag-budgets). These config tags are separate from tags created with `/tag/new`.

## Model access group budgets {#model-access-group-budgets}

A model access group can share one budget across every key that reaches a model in the group. Set it with `PUT /access_group/{access_group}/budget`, read it with `GET` and remove it with `DELETE` on the same path. See [Model access group budgets](./model_access_group_budgets.md).

## Per-model budgets {#per-model-budgets}

`model_max_budget` caps spend on individual models underneath the overall budget of a key, internal user, team, team member or legacy customer, each model with its own limit and reset window. A request to a capped model is rejected once that model's spend reaches its limit, while the scope's other models keep working, and [budget fallbacks](./budget_fallbacks.md) can reroute the key to another model instead. See [Per-model budgets](./per_model_budgets.md).

## Budgets and spend tracking {#spend-tracking}

### No prepaid balance

Budgets cap spend; they do not hold a prepaid balance. Spend is LiteLLM's own cost calculation for each request, so a budget is only as accurate as the model prices behind it. See [Spend tracking](./cost_tracking.md) and [Custom pricing](./custom_pricing.md).

### Spend fields

| Field | Where | Meaning |
| --- | --- | --- |
| `spend` | Every scope that carries a budget | Spend in the current window, reset at `budget_reset_at` |
| `total_spend` | Keys and team memberships | Lifetime spend, never reset |
| `model_spend` | Keys, internal users, teams, projects and organizations | Spend broken down by model |
| `budget_reset_at` | Scopes with a `budget_duration` | When the current window ends |

### Reset job

A background job resets budgets whose `budget_reset_at` has passed, about every ten minutes by default, so a budget can stay blocked for a few minutes after its window ends. Daily, weekly and monthly windows align to calendar boundaries in the configured timezone. See [Budget reset times and timezones](./budget_reset_and_tz.md#reset-job).

### Window storage

Spend for each [`budget_limits` window](./budget_windows.md) is kept per entity and window in the `LiteLLM_BudgetWindowSpend` table, so each window resets on its own schedule.

## Related pages

- [Token Redaction in Spend Logs](https://docs.litellm.ai/docs/proxy/token_redaction_spend_logs.md)
- [Whole proxy](https://docs.litellm.ai/docs/proxy/proxy_budget.md)
