Shared budgets
A shared budget is a row in LiteLLM's budget table that holds limits such as max_budget, budget_duration, tpm_limit and rpm_limit. Create it once with /budget/new, then attach it to keys, customers, tags, organizations, projects or model access groups by its budget_id. Every object on the row gets the same limits and counts its own spend against them, so a row works like a pricing tier. Edit the row and the limits change for everything on it.
Several scopes keep their budget in a row even when you never call /budget/new. Organizations, projects, customers, tags, model access groups and team memberships store their limits in a row referenced by budget_id, and LiteLLM creates a private row for one of them when you pass budget fields such as max_budget. Teams, internal users and keys keep max_budget and budget_duration on their own record, and a key can also point at a row through budget_id.
How it works
On each request LiteLLM reads the limits from the row and compares them with the calling object's own spend, so Customer B reaching $50 blocks only Customer B. When the row's budget_duration ends, the reset job resets the spend of every object on the row at the same moment. A key that has its own budget_duration resets on its own schedule instead.
When to use it
Reach for a shared budget when many objects should get the same limits. Typical cases are a free tier and a paid tier for the customers of your application, each a row that many customers point at, and a standard allowance and rate limit for a batch of keys, as in Budget and rate limit tiers. Moving a customer or key to another tier is one budget_id change, and changing a tier is one /budget/update. A row is also what max_end_user_budget_id and a key's end_user_budget_id point at to give customers without a budget of their own a default, as described in Default budgets.
A shared row never pools spend. To cap the combined spend of many callers, put them under one team, tag, organization or model access group and budget that object. To give every member of a team the same allowance, set the team's team_member_budget as described in Team members. Customer Management has its own member budget templates that work the same way for its members.
Supported scopes
| Scope | Supported | How to set it |
|---|---|---|
| Whole proxy | No | The proxy budget is max_budget under litellm_settings. |
| Organization | Yes | budget_id on /organization/new, or on /organization/update to move it to another row Since v1.114.0. |
| Team | No | Teams keep max_budget and budget_duration on the team record. |
| Team member | No | LiteLLM manages these rows. The team's team_member_budget creates one row that every member without their own budget shares, and max_budget_in_team gives one member a private row. |
| Project | Yes | budget_id on /project/new, or on /project/update to move it to another row Since v1.114.0. |
| Virtual key | Yes | budget_id on /key/generate or /key/update. The key's own max_budget, tpm_limit, rpm_limit and model_max_budget win over the row's. |
| Internal user | No | Users keep max_budget and budget_duration on the user record. |
| Customer | Yes | budget_id on /customer/new or /customer/update, or max_end_user_budget_id and a key's end_user_budget_id for customers without their own. Customer Management uses member budget templates instead. |
| Tag | Yes | budget_id on /tag/new or /tag/update. |
| Model access group | Yes | budget_id on PUT /access_group/{access_group}/budget. |
| AI tool | No | Tool limits are stored per team and member through /team/{team_id}/ai_tool_budgets, not in budget rows. |
| Agent session | No | max_budget_per_session lives in the agent's litellm_params. |
How to use it
Create a row
Only a proxy admin can create, change or delete rows. Leave out budget_id and LiteLLM generates one.
curl -X POST 'http://0.0.0.0:4000/budget/new' \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{
"budget_id": "pro-tier",
"max_budget": 50,
"budget_duration": "30d",
"tpm_limit": 100000,
"rpm_limit": 100
}'
/budget/new also accepts soft_budget, max_parallel_requests, tpd_limit, model_max_budget, model_tpm_limit, model_rpm_limit and budget_limits. Not every scope reads every field, as the table under What each scope reads shows.
Attach it
Pass the row's ID when you create or update an object. A customer:
curl -X POST 'http://0.0.0.0:4000/customer/new' \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"user_id": "customer-123", "budget_id": "pro-tier"}'
A virtual key, created without its own max_budget so the row's cap applies:
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": "pro-key-1", "budget_id": "pro-tier"}'
Tags take budget_id on /tag/new, organizations on /organization/new, projects on /project/new, and model access groups on PUT /access_group/{access_group}/budget. To move one object to another row later, send only the new budget_id to /key/update, /customer/update, /tag/update, /organization/update, /project/update or the access group endpoint. Organizations and projects accept a new budget_id on update Since v1.114.0. Each object's info endpoint, such as /customer/info, /key/info or /tag/info, returns that object's own spend.
What each scope reads
| Scope | Row fields LiteLLM applies |
|---|---|
| Organization | max_budget, budget_duration, tpm_limit, rpm_limit |
| Project | max_budget, soft_budget, budget_duration |
| Virtual key | soft_budget, plus max_budget, tpm_limit, rpm_limit, tpd_limit and model_max_budget where the key has no value of its own, and budget_duration when the key has none |
| Customer | max_budget, budget_duration, tpm_limit, rpm_limit, tpd_limit, model_max_budget, model_tpm_limit, model_rpm_limit |
| Tag | max_budget, budget_duration, tpm_limit, rpm_limit |
| Model access group | max_budget, budget_duration |
Rate limits from a row are per object too: two keys on a row with rpm_limit: 100 can each send 100 requests per minute.
Read and change rows
POST /budget/info with {"budgets": ["pro-tier"]} returns the listed rows. GET /budget/list returns every row, and GET /management/v1/budgets Since v1.96.0 returns them paged, with sorting and filters. Proxy admins and admin viewers can read both lists.
POST /budget/update changes a row for every object on it. Send the budget_id and only the fields to change.
curl -X POST 'http://0.0.0.0:4000/budget/update' \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"budget_id": "pro-tier", "max_budget": 75}'
POST /budget/delete with {"id": "pro-tier"} removes a row. See Limits for what happens to the objects still on it.
Admin UI
Open Budgets under Access Control and select Create Budget. Enter a Budget ID, a Max Budget with its Reset period, and optional Tokens per minute, Requests per minute and Batch tokens per day limits. Edit or delete a row from its actions menu. On the key form, a proxy admin can pick a row as the key's Default Customer Budget, which sets its end_user_budget_id.
Limits
Budget fields sent to an object's own update endpoint edit the row it points at. On a shared row, max_budget sent to /organization/update, /project/update, /customer/update, /tag/update or PUT /access_group/{access_group}/budget, or soft_budget sent to /key/update, changes the limit for every object on that row. To change one object, move it to its own row first.
A few create requests replace the shared row with a private one. /key/generate with a soft_budget next to budget_id creates a new row for the key and drops the shared one, and /customer/new with any other budget field next to budget_id does the same (max_budget together with budget_id is rejected). On keys, default_key_generate_params and upperbound_key_generate_params can also fill the key's own max_budget, budget_duration, tpm_limit and rpm_limit, which then win over the row's. See Default budgets.
A row with budget_limits windows, such as one created in the Admin UI with the per month and year reset option, cannot be attached to any scope on this page, and adding windows to a row that one of them already uses is rejected. Windows are for Customer Management.
Deleting a row that keys, customers, projects, tags or model access groups still use detaches it, and those objects lose its limits. A row that an organization uses cannot be deleted, and Customer Management templates are deleted through Customer Management. Changes made through /budget/* are not recorded in audit logs.
Related
Budgets covers every budget scope, Default budgets covers settings that point new customers at a row, and Legacy end users walks through customer pricing tiers end to end.