---
title: "Setting Team Budgets"
url: "/docs/proxy/team_budgets"
canonical_url: "https://docs.litellm.ai/docs/proxy/team_budgets"
type: "docs"
last_updated: "2026-10-09"
related:
  - "/docs/proxy/users"
  - "/docs/proxy/project_management"
---
# Setting Team Budgets

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


## Pre-Requisites

- You must set up a Postgres database (e.g. Supabase, Neon, etc.)

## Default Budget for Auto-Generated JWT Teams

When using JWT authentication with `team_id_upsert: true`, you can automatically assign a default budget to any newly created team.

This is configured in `default_team_settings` in your `config.yaml`.

**Example:**
```yaml
# in your config.yaml

litellm_jwtauth:
  team_id_upsert: true
  team_id_jwt_field: "team_id"
  # ... other jwt settings

litellm_settings:
  default_team_settings: 
    - team_id: "default-settings"
      max_budget: 100.0
```
Track spend, set budgets for your Internal Team

## Setting Monthly Team Budgets

### 1. Create a team 
- Set `max_budget=000000001` ($ value the team is allowed to spend)
- Set `budget_duration="1d"` (How frequently the budget should update)

**API**

Create a new team and set `max_budget` and `budget_duration`
```shell
curl -X POST 'http://0.0.0.0:4000/team/new' \
     -H "Authorization: Bearer $LITELLM_API_KEY" \
     -H 'Content-Type: application/json' \
     -d '{
            "team_alias": "QA Prod Bot", 
            "max_budget": 0.000000001, 
            "budget_duration": "1d"
        }' 
```

Response
```shell
{
 "team_alias": "QA Prod Bot",
 "team_id": "de35b29e-6ca8-4f47-b804-2b79d07aa99a",
 "max_budget": 0.0001,
 "budget_duration": "1d",
 "budget_reset_at": "2024-06-14T22:48:36.594000Z"
}  
```

**Admin UI**

Possible values for `budget_duration`

| `budget_duration` | When Budget will reset |
| --- | --- |
| `budget_duration="1s"` | every 1 second |
| `budget_duration="1m"` | every 1 min |
| `budget_duration="1h"` | every 1 hour |
| `budget_duration="1d"` | every 1 day |
| `budget_duration="30d"` | every 1 month |

### 2. Create a key for the `team`

Create a key for Team=`QA Prod Bot` and `team_id="de35b29e-6ca8-4f47-b804-2b79d07aa99a"` from Step 1 

**API**

💡 **The Budget for Team="QA Prod Bot" budget will apply to this team**

```shell
curl -X POST 'http://0.0.0.0:4000/key/generate' \
     -H "Authorization: Bearer $LITELLM_API_KEY" \
     -H 'Content-Type: application/json' \
     -d '{"team_id": "de35b29e-6ca8-4f47-b804-2b79d07aa99a"}'
```

Response

```shell
{"team_id":"de35b29e-6ca8-4f47-b804-2b79d07aa99a", "key":"sk-5qtncoYjzRcxMM4bDRktNQ"}
```

**Admin UI**

### 3. Test It

Use the key from step 2 and run this Request twice

**API**

```shell
curl -X POST 'http://0.0.0.0:4000/chat/completions' \
     -H 'Authorization: Bearer sk-mso-JSykEGri86KyOvgxBw' \
     -H 'Content-Type: application/json' \
     -d ' {
           "model": "llama3",
           "messages": [
             {
               "role": "user",
               "content": "hi"
             }
           ]
         }'
```

On the 2nd response - expect an HTTP 422 with the following error

```shell
{
 "error": {
   "message": "Budget has been exceeded! Team=de35b29e-6ca8-4f47-b804-2b79d07aa99a Current cost: 3.5e-06, Max budget: 1e-09",
   "type": "budget_exceeded",
   "param": null,
   "code": "422"
 }
}
```

To return 429 instead, set `budget_exceeded_status_code: 429` under `litellm_settings` in your config.yaml

**Admin UI**

## Advanced

### Prometheus metrics for `remaining_budget`

[More info about Prometheus metrics here](https://docs.litellm.ai/docs/proxy/prometheus)

You'll need the following in your proxy config.yaml

```yaml
litellm_settings:
  success_callback: ["prometheus"]
  failure_callback: ["prometheus"]
```

Expect to see this metric on prometheus to track the Remaining Budget for the team

```shell
litellm_remaining_team_budget_metric{team_alias="QA Prod Bot",team_id="de35b29e-6ca8-4f47-b804-2b79d07aa99a"} 9.699999999999992e-06
```

## See Also

- [Per-model TPM/RPM for teams](./users.md#set-rate-limits) - Set rate limits per model for all keys in a team

## Related pages

- [Budgets, Rate Limits](https://docs.litellm.ai/docs/proxy/users.md)
- [[Beta] Project Management](https://docs.litellm.ai/docs/proxy/project_management.md)
