---
title: "Soft budgets and budget alerts"
url: "/docs/proxy/budget_alerts"
canonical_url: "https://docs.litellm.ai/docs/proxy/budget_alerts"
type: "docs"
last_updated: "2026-12-02"
summary: "Alert key, team, project and user owners by Slack, webhook or email as spend nears or crosses a budget, with soft budgets that never block requests."
related:
  - "/docs/proxy/budget_rollover"
  - "/docs/proxy/ui_team_soft_budget_alerts"
---
# Soft budgets and budget alerts

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


Available in LiteLLM v1.28.11 and later.

A soft budget is a USD amount that only warns. Set `soft_budget` on a virtual key, team or project, and LiteLLM sends an alert once that scope's spend reaches it, while requests keep working until the scope's `max_budget` runs out. Budget alerts also cover the `max_budget` itself, both as it runs low and when it is used up.

Alerts reach people in two ways. Slack, Microsoft Teams and webhook destinations listed in `general_settings.alerting` get an alert when a soft budget is crossed, when 15% and then 5% of a `max_budget` is left, and when it is crossed. Email alerts go out at percentages of `max_budget` that you choose, each with its own recipients, through `metadata.max_budget_alert_emails` on a key or team, `metadata.team_member_max_budget_alert_emails` on a team, and `litellm_settings.default_key_max_budget_alert_emails` for every key. Not every scope sends every kind of alert, and the [scope table](#supported-scopes) lists what each one sends. On this page, Slack also stands for Microsoft Teams, which receives the same budget alerts.

## How it works

```mermaid
flowchart LR
  accTitle: A key's spend crossing its soft budget and then its max budget
  accDescr: A key has a soft budget of 80 dollars and a max budget of 100 dollars. Once its spend reaches 80 dollars, the next request sends a soft budget alert and is still served. Once spend reaches 85 dollars, with 15 percent left, the next request sends a threshold alert and is still served. Once spend reaches 100 dollars, the next request sends a budget crossed alert and is rejected.
  S1["Spend under $80"] -->|"reaches $80<br/>soft_budget"| S2["Soft budget alert<br/>request served"]
  S2 -->|"reaches $85<br/>15% left"| S3["Threshold alert<br/>request served"]
  S3 -->|"reaches $100<br/>max_budget"| S4["Budget crossed alert<br/>request rejected"]
  classDef default fill:#ffffff,stroke:#9ca3af,color:#111827;
```

LiteLLM records spend after each response and checks budgets when the next request arrives. An alert therefore goes out with the first request after spend reaches a threshold, and that request is still served unless spend has reached `max_budget`, in which case it fails with `budget_exceeded`. Once sent, the same alert is held back for 24 hours by default, as [Alert de-duplication](#alert-de-duplication) explains.

## When to use it

Set a soft budget below a hard cap to warn a key owner or team lead before traffic stops, for example `soft_budget: 800` on a team with a $1,000 monthly `max_budget`. Use percentage email thresholds when finance or on-call should hear at several points, such as 50%, 75% and 90% of a key's or team's budget, with different people at each level. Use Slack or webhook budget alerts to feed one channel, or your own billing system, with every key, user and proxy budget that runs low or runs out. Use team member thresholds to warn each person about their own allowance inside a team.

A soft budget never slows or stops traffic. To cap spend, set a `max_budget` as described in [Budgets and spend limits](./budgets.md). To keep an over-budget key serving at reduced throughput, use [throttling](./budget_throttling.md). For budgets on your own product's customers, use the [Customer Management budget webhooks](./customer_management/track-customer-spend.md#1-set-up-budget-webhooks), and for periodic spend summaries that do not depend on a budget, use the `spend_reports` alert type in [Alerting](./alerting.md#all-possible-alert-types).

## Supported scopes

| Scope | Supported | How to set it |
| --- | --- | --- |
| Whole proxy | 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. |
| Organization | Yes | Set `max_budget` on `/organization/new` or `/organization/update`. Slack and webhook alert only when a request is rejected over it. A `soft_budget` on an organization is stored but sends nothing. |
| Team | Yes | `metadata.max_budget_alert_emails` on `/team/new` or `/team/update` for emails at percentages of `max_budget`, or the legacy `soft_budget` with `metadata.soft_budget_alerting_emails` described in [Team soft budget alerts](./ui_team_soft_budget_alerts.md). Slack and webhook alert when a request is rejected over `max_budget`. |
| Team member | Yes | `metadata.team_member_max_budget_alert_emails` on the team for emails at percentages of each member's budget. Once spend reaches the lowest percentage, Slack and webhook alerts at 15% and 5% left and when crossed. No soft budget. |
| Project | Yes | `soft_budget` on `/project/new` or `/project/update` sends a Slack and webhook alert and emails the owner of the key that sent the request. Slack and webhook alert when a request is rejected over `max_budget`. Projects need Enterprise. |
| Virtual key | Yes | `soft_budget` on `/key/generate` or `/key/update` alerts Slack and webhooks and emails the key owner. `max_budget` sends Slack and webhook alerts at 15% and 5% left and when crossed, and emails the owner at 80% or at the percentages in `metadata.max_budget_alert_emails`. |
| Internal user | Yes | Set `max_budget` on `/user/new` or `/user/update`. Slack and webhook alerts at 15% and 5% left and when crossed, on requests that the personal budget applies to. No soft budget or email. |
| Customer | Yes | Customer Management only. Its `soft_budget` and `max_budget` send `soft_budget_crossed` and `budget_crossed` to the `customer_budget_webhook` callback. A `soft_budget` on `/customer/new` for legacy end users sends nothing. |
| Tag | No | `/tag/new` stores a `soft_budget` but nothing checks it, and an exhausted tag budget sends no alert. |
| Model access group | No | The group's `soft_budget` is stored but nothing checks it, and an exhausted group budget sends no alert. |
| AI tool | Yes | Slack and webhook alerts at 80% and at the limit of a budget set with `PUT /team/{team_id}/ai_tool_budgets`. See [AI tool budgets](./ai_tool_budgets.md). No soft budget. |
| Agent session | No | A session that reaches `max_budget_per_session` gets a 429 and no alert is sent. |

## How to use it

### Turn on alert destinations

List the destinations under `general_settings.alerting`. Slack reads its URL from `SLACK_WEBHOOK_URL`, webhooks post to `WEBHOOK_URL`, and email needs an email integration (Resend, SendGrid or SMTP) configured through its environment variables.

```yaml title="config.yaml"
general_settings:
  alerting: ["slack", "webhook", "email"]
  alerting_args:
    budget_alert_ttl: 86400
```

The `budget_alerts` alert type is on by default. If you set `general_settings.alert_types`, include `budget_alerts` in the list, or Slack and webhooks get no budget alerts. To send budget alerts to their own Slack channel, map `budget_alerts` in `alert_to_webhook_url`. See [Alerting](./alerting.md#quick-start) for Slack, [Map Slack channels to alert type](./alerting.md#map-slack-channels-to-alert-type), [Webhooks for budget alerts](./alerting.md#beta-webhooks-for-budget-alerts) and [Email notifications](./email.md#1-configure-email-integration).

### Set a soft budget

Pass `soft_budget` with the scope's other budget fields. On a key, the alert goes to Slack and webhooks, and to the key owner's email when `email` is in `general_settings.alerting`. In the Admin UI, the key's edit view has a **Soft Budget (USD)** field.

```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": "prod-app", "max_budget": 100, "budget_duration": "30d", "soft_budget": 80}'
```

A project's soft budget alerts Slack and webhooks, and emails the owner of whichever key sent the request. When a team or project request sets both, `soft_budget` must be lower than `max_budget`.

```bash
curl -X POST 'http://0.0.0.0:4000/project/update' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"project_id": "support-bot", "max_budget": 500, "soft_budget": 400}'
```

A team's soft budget sends nothing unless the team also lists recipients in `metadata.soft_budget_alerting_emails`. Those addresses are then emailed even when `email` is not in `general_settings.alerting`, and any Slack or webhook destination listed there gets the alert too. This fixed-dollar alert is the legacy option for teams. [Team soft budget alerts](./ui_team_soft_budget_alerts.md) walks through it, and percentage thresholds below replace it for teams with a `max_budget`.

### Email alerts at percentages of max_budget

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

Email alerts need `email` in `general_settings.alerting` and an email integration. Each one maps a whole-number percentage of the scope's budget to the recipients notified once spend crosses it.

On a key, set `metadata.max_budget_alert_emails` on `/key/generate` or `/key/update` (since LiteLLM v1.83.10), or fill in **Budget Alert Thresholds** in the key's form (since LiteLLM v1.111.0). The key owner's email is always added to each threshold's recipients. A key without the map emails only its owner, once spend reaches 80% of `max_budget`, so a key whose owner has no email sends nothing. `EMAIL_BUDGET_ALERT_MAX_SPEND_ALERT_PERCENTAGE` changes that default, for example to `0.9`. A 100% threshold still sends on the request that is rejected, because the alert check runs first.

```bash
curl -X POST 'http://0.0.0.0:4000/key/update' \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "key": "sk-...",
    "metadata": {
      "max_budget_alert_emails": {
        "50": ["owner@example.com"],
        "90": ["owner@example.com", "finance@example.com"],
        "100": ["oncall@example.com"]
      }
    }
  }'
```

`litellm_settings.default_key_max_budget_alert_emails` gives every key a baseline map. A key's own entries merge into it one threshold at a time, so a key keeps the baseline recipients for a percentage and adds its own.

```yaml title="config.yaml"
litellm_settings:
  default_key_max_budget_alert_emails:
    "80": ["platform-team@example.com"]
```

On a team, `metadata.max_budget_alert_emails` alerts on the team's combined spend across all its keys (since LiteLLM v1.112.0), and `metadata.team_member_max_budget_alert_emails` alerts on each member's spend inside the team against their member budget (since LiteLLM v1.105.0). Team alerts go only to the listed recipients. The team needs a positive `max_budget`, and each percentage must be a whole number from 1 to 100 with at least one recipient, or the update is rejected. Member alerts always include the member's own email, so an empty list notifies only the member, and invalid member entries are ignored. The `metadata` you send replaces the team's metadata, so include any keys you want to keep.

```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",
    "max_budget": 1000,
    "team_member_budget": 100,
    "metadata": {
      "max_budget_alert_emails": {
        "75": ["finance@example.com"],
        "90": ["finance@example.com", "research-lead@example.com"]
      },
      "team_member_max_budget_alert_emails": {
        "80": [],
        "100": ["research-lead@example.com"]
      }
    }
  }'
```

In the Admin UI, open **Teams** and select the team. **Team Budget Alerts** under **Settings > Edit Settings** holds the team percentages, and **Budget Alert Thresholds** under **Member Defaults > Edit Defaults** holds the member percentages. See [Email notifications](./email.md#3-configure-budget-alerts-optional) for the full rules and email templates.

### Slack and webhook alerts

Slack and webhook budget alerts need no per-scope setup beyond the budget itself. Each alert carries an `event` of `soft_budget_crossed`, `threshold_crossed` (15% or 5% of `max_budget` left) or `budget_crossed`, and an `event_group` naming the scope, such as `key`, `team`, `team_member`, `user`, `project`, `organization` or `proxy`. A key with a soft budget also sends `projected_limit_exceeded` when its spend so far projects past the soft budget before its budget window ends, or before the end of the month for a key without `budget_duration`. Webhooks receive the alert as JSON, and [API spec for webhook event](./alerting.md#api-spec-for-webhook-event) lists every field.

### Alert de-duplication

Each email alert sends at most once per `EMAIL_BUDGET_ALERT_TTL` seconds, 24 hours by default, for the same key, team or team member and the same percentage. Slack and webhook alerts send at most once per `general_settings.alerting_args.budget_alert_ttl` seconds, also 24 hours by default, for the same scope and the same `event`. A budget reset does not clear these windows, so an alert can repeat a day later while spend stays above its threshold. AI tool alerts and Customer Management budget webhooks work differently and send each event once per budget period.

```bash
export EMAIL_BUDGET_ALERT_TTL=43200
```

With several workers or pods, configure Redis as described in [What needs Redis](./redis_requirements.md) so they share one de-duplication window. Without it, each process keeps its own window and can send the same alert again.

## Limits

The 15% and 5% Slack alerts share the `threshold_crossed` event, so only the first of them sends within one `budget_alert_ttl` window. A key `soft_budget` of `0` counts as no soft budget, so use a small positive value such as `0.01` to test. Project soft budget alerts are de-duplicated per calling key rather than per project, so a project used by several keys sends one alert for each key, each emailed to that key's owner.

Organizations, tags, model access groups and legacy customers accept a `soft_budget` field but never alert on it. When `general_settings.alerting` lists `email` together with `slack`, `ms_teams` or `webhook`, each Slack budget alert is also emailed over SMTP to the user named in the alert, and a team alert to every member of the team, using only the `SMTP_*` settings.

## Related

See [Budgets and spend limits](./budgets.md) for setting the budgets these alerts watch, [Alerting](./alerting.md) for Slack, Microsoft Teams and webhook setup, [Email notifications](./email.md) for email integrations and templates, and [Team soft budget alerts](./ui_team_soft_budget_alerts.md) for the legacy team walkthrough.

## Related pages

- [Budget rollover](https://docs.litellm.ai/docs/proxy/budget_rollover.md)
- [Team soft budget alerts](https://docs.litellm.ai/docs/proxy/ui_team_soft_budget_alerts.md)
