---
title: "Whole proxy budget"
url: "/docs/proxy/proxy_budget"
canonical_url: "https://docs.litellm.ai/docs/proxy/proxy_budget"
type: "docs"
last_updated: "2026-12-02"
summary: "Cap the combined spend of every request through the LiteLLM proxy with litellm_settings.max_budget and a budget_duration that resets it."
related:
  - "/docs/proxy/budgets"
  - "/docs/proxy/organization_budgets"
---
# Whole proxy budget

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


`litellm_settings.max_budget` caps the combined spend of every request through the proxy, whichever key, team, user or customer sends it. The master key and proxy admin keys are not exempt. It sits above every other scope, and organization, team, team member, project, key and user budgets still apply under it. LiteLLM checks every budget a request falls under and rejects the request when any one of them is over its cap, so once proxy spend passes `max_budget`, every inference request fails until the budget resets or you raise it.

:::warning[Budgets require a database]

The proxy, organization, team, team member, key and user budgets are enforced against spend read from the database, so none of them cap anything on a [DB-less deployment](./docker_quick_start.md#running-without-a-database). `litellm_settings.max_budget` fails open there rather than erroring: the proxy's spend is only loaded when a database client exists, and with no total to compare against, the check is skipped and requests keep being served past the limit. A warning is logged once at startup when a budget is set with no database connected, but nothing blocks at request time. Key, team and user budgets are unavailable for the same reason, since virtual keys cannot be resolved without a database (`No connected db.`). Run with a database if a budget is part of how you bound spend.

:::

## How it works

LiteLLM keeps the proxy's spend on a reserved internal user record with the ID `litellm-proxy-budget`. At startup, with a database connected, it creates or updates that record with your `max_budget` and `budget_duration`, and the cost of every request is added to it for as long as `max_budget` is above 0. The background reset job sets its spend back to 0 at the end of each `budget_duration`, on the same schedule as other budgets. See [Budget reset times and timezones](./budget_reset_and_tz.md).

The check runs on every inference request, including provider pass-through routes. Management routes such as `/key/generate` and model list routes such as `/v1/models` are not checked, and requests that cost nothing, such as a call to a [model priced at zero](./free_model_budgets.md), skip it like every other budget.

## When to use it

Use it as a last-resort ceiling on what one deployment can spend in total, such as a sandbox or proof-of-concept proxy, or a safety net above the team budgets of a production proxy. Because one caller can use up the whole amount and block everyone else, pair it with [team budgets](./team_budgets.md) or [key budgets](./key_budgets.md) that split the spend between groups. To stop sending traffic to a provider or deployment that has used up its own allowance, rather than rejecting callers, use [budget routing](./provider_budget_routing.md).

## Set a budget

**Step 1. Set the budget in config.yaml**

```yaml
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
  database_url: os.environ/DATABASE_URL

litellm_settings:
  max_budget: 100 # USD across all proxy spend. 0, the default, means no cap
  budget_duration: 30d # how often spend resets, such as "30s", "30m", "1h", "1d" or "1mo"
```

`budget_duration` is required whenever a database is connected. If `max_budget` is set without it, the proxy fails to start with `budget_duration not set on Proxy. budget_duration is required to use max_budget.`

**Step 2. Start the proxy**

```bash
litellm --config /path/to/config.yaml
```

**Step 3. Send a test call**

```bash
curl 'http://0.0.0.0:4000/chat/completions' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-6-luna",
    "messages": [{"role": "user", "content": "what llm are you"}]
  }'
```

Once the proxy's spend is over `max_budget`, requests fail with a `budget_exceeded` error. The status is `422` unless you set `budget_exceeded_status_code`, as described in [Budget exceeded errors](./budget_exceeded_errors.md).

```json
{
  "error": {
    "message": "Budget has been exceeded! Current cost: 100.0021, Max budget: 100.0",
    "type": "budget_exceeded",
    "param": null,
    "code": "422"
  }
}
```

## Check spend

Read the `litellm-proxy-budget` record with a proxy admin key. `user_info` in the response holds the current period's `spend`, `max_budget`, `budget_duration` and `budget_reset_at`.

```bash
curl 'http://0.0.0.0:4000/user/info?user_id=litellm-proxy-budget' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY"
```

`/global/spend` is not the same number. It adds up the spend logs of the last 30 days, which does not follow the budget's reset window. With [alerting](./budget_alerts.md) configured, LiteLLM also sends Slack and webhook alerts as the proxy nears and crosses `max_budget`.

## Change or remove a budget

Change `max_budget` or `budget_duration` in `config.yaml` and restart the proxy. The spend already counted in the current period is kept, so a lower cap can block requests straight away. The current period still ends on its original `budget_reset_at`, and a new `budget_duration` applies from that reset on.

To remove the cap, delete `max_budget` or set it to `0`, then restart. While the cap is off, LiteLLM stops adding spend to the `litellm-proxy-budget` record.

## Default budget

The proxy has no cap until you set `max_budget`, and `0`, the default, also means no cap. This setting is the proxy's only budget, so there is no separate default for it. See [Default budgets](./default_budgets.md#whole-proxy).

## Budget features

Which budget features work on whole proxy budgets. Each feature page lists every scope it supports.

| Feature | Supported | Details |
| --- | --- | --- |
| [Shared budgets](./shared_budgets.md) | No | The proxy budget is `max_budget` under `litellm_settings`. |
| [Default budgets](./default_budgets.md) | No | `litellm_settings.max_budget` with `budget_duration` is the proxy's only budget, so there is nothing to default. See [Whole proxy budget](./proxy_budget.md). |
| [Per-model budgets](./per_model_budgets.md) | No | There is no proxy-wide per-model cap. [Budget routing](./provider_budget_routing.md#model-budgets) caps a deployment for every caller. |
| [Multiple budget windows](./budget_windows.md) | No | `litellm_settings` takes one `max_budget` and one `budget_duration`. |
| [Budget reset times and timezones](./budget_reset_and_tz.md) | Yes | `litellm_settings.budget_duration` next to `litellm_settings.max_budget`. |
| [Budget rollover](./budget_rollover.md), overage carry-over | Yes | Spend above `litellm_settings.max_budget` carries over at the `budget_duration` reset. |
| [Budget rollover](./budget_rollover.md), unused budget carry-over | No | - |
| [Soft budgets and budget alerts](./budget_alerts.md) | Yes | Set `litellm_settings.max_budget`. Slack and webhook alerts at 15% and 5% left and when it is crossed. No soft budget or email. |
| [Team soft budget alerts](./ui_team_soft_budget_alerts.md) | No | The proxy budget sends Slack and webhook alerts instead. See [Soft budgets and budget alerts](./budget_alerts.md). |
| [Budget exceeded errors](./budget_exceeded_errors.md) | Yes | `Budget has been exceeded! Current cost: <spend>, Max budget: <cap>` |
| [Throttle over-budget keys](./budget_throttling.md) | No | The proxy-wide `max_budget` still rejects every request once it runs out. |
| [Budget fallbacks](./budget_fallbacks.md) | No | Router `fallbacks` in `config.yaml` handle provider errors, not budgets. |
| [Temporary budget increase](./temporary_budget_increase.md) | No | - |
| [Budget reservation](./budget_reservation.md) | No | `litellm_settings.max_budget` is checked against recorded spend only. |
| [Fail-closed budget enforcement](./fail_closed_budgets.md) | No | Proxy-wide spend is read from its own database row on a separate path that the setting does not change. |
| [Free models and budgets](./free_model_budgets.md) | Yes | `litellm_settings.max_budget` is not checked. |
| [Self-serve budget changes](./self_serve_budgets.md) | No | - |

## Limits

[Fail-closed budget enforcement](./fail_closed_budgets.md) does not cover the proxy budget, since its spend is read from its own database record on a separate path. `/global/spend/reset` sets key and team spend to 0 but leaves the proxy's spend alone, so the proxy budget only resets on its `budget_duration`. With [custom auth](./custom_auth.md), budget checks, this one included, run only when `general_settings.custom_auth_run_common_checks` is `true`.

## Related

[Budgets](./budgets.md) covers every budget scope, [Budget precedence](./access_management/inheritance.md#budgets) lists which caps apply to each kind of request, and [Spend tracking](./cost_tracking.md) explains how LiteLLM prices each request.

## Related pages

- [Budgets and spend limits](https://docs.litellm.ai/docs/proxy/budgets.md)
- [Organizations](https://docs.litellm.ai/docs/proxy/organization_budgets.md)
