Skip to main content

Team member budgets

A team member budget caps what one person spends on requests scoped to one team, in USD. It counts spend from the team's keys that the member owns and from SSO or JWT sessions where the member acts for the team, so someone in two teams has a separate budget and separate spend in each. Service account keys have no owner, so no member budget applies to them.

A team sets a default allowance for every member with team_member_budget and its reset period with team_member_budget_duration, and max_budget_in_team on one membership replaces that default for that member. Neither changes the team budget, which still caps all members together, and LiteLLM also checks the key, project and organization budgets above and beside it. Any one of them over its cap rejects the request, so a member can still be blocked when the team runs out.

How it works​

Members without their own budget share the team's default budget row, and each counts their own spend against it. Because they read the row at request time, changing team_member_budget reaches every member still on the default. A member with max_budget_in_team has a private row instead, and later changes to the default leave them alone. A temporary increase on the member adds to whichever amount applies until it expires. Team member budget precedence states the order, and the worked example there shows a raised member still blocked by the team cap.

Once a member's spend in the team reaches their budget, requests fail with a budget_exceeded error whose message names the member and the team, for example Budget has been exceeded! User=alice in Team=e8d1460f-846c-45d7-9b43-55f3cc52ac32 ....

Existing spend counts against a budget added later​

Spend is tracked for every team member, including members with no budget. On the team's Members tab, Current Period Spend (USD) is the value checked against the member's budget and it goes back to $0 when the member's budget_duration window rolls over, while Total Spend (USD) is cumulative and never resets. A member with no budget has no budget window, so their current period spend is never reset automatically and keeps growing. Older versions only tracked spend for members that had a budget, and a member added on one of those versions starts being tracked on their next request after the upgrade.

If you give that member a budget later, the spend they already accrued counts against it right away. This applies both to setting team_member_budget on the team with /team/update, which links the team's member budget to every member that has no budget yet, and to setting max_budget_in_team for one member with /team/member_update. For example, a member spends $500 with no budget, an admin then sets a $100 member budget, and the member's next request is rejected with a budget exceeded error.

There are two ways out. If the new budget has a budget_duration, the member's current period spend goes back to $0 at the next reset and they are unblocked without any action. If it has no budget_duration, the member stays blocked until someone resets their spend in the UI or through the API.

When to use it​

Set a team default when everyone in a team should get the same allowance, so one person cannot spend the whole team budget. Give one member max_budget_in_team when their work needs more, or less, than the default. To give groups of people different allowances, put each group in its own team with its own default, as in Tiered SSO budgets.

A member budget only covers spend inside its team. To cap what a person spends across all their personal keys, use an internal user budget. An organization's max_budget_in_organization is tracked but never blocks a request, so a team member budget is the way to enforce a per-person cap.

Set a budget​

A proxy admin, an admin of the team, or an org admin of the team's organization can set member budgets. A team admin changes the team default only through the fields that general_settings.team_admin_editable_team_fields lists, such as team_member_budget and team_member_budget_duration, while per-member budgets on /team/member_add and /team/member_update need no extra permission. See Choosing what team admins can edit.

When the team default is first created without team_member_budget_duration, members reset on the team's own budget_duration. Send "team_member_budget_duration": null to keep member budgets from resetting.

Set team member budgets in the Admin UI​

To give every member of a team the same allowance:

  1. Go to Teams and open the team.
  2. Open the Member Defaults tab and click Edit Defaults.
  3. Enter Default Budget (USD) and pick a Default Budget Duration, then click Save Changes.

You can also set Team Member Budget (USD) under Additional Settings when you create the team.

To give one member a different budget:

  1. Open the team's Members tab.
  2. In the member's row, click Edit member in the Actions column.
  3. In the Edit Member dialog, set Team Member Budget (USD) and, if it should reset, Budget Reset Period. To add a time-limited increase, fill in Temporary Budget Increase (USD) and Temporary Budget Expiry (UTC).
  4. Click Save Changes.

Set team member budgets with the API​

To give every member the same default, set team_member_budget and team_member_budget_duration on /team/new or /team/update.

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": "e8d1460f-846c-45d7-9b43-55f3cc52ac32", "team_member_budget": 120, "team_member_budget_duration": "1mo"}'

To give one member their own budget, follow these steps.

Step 1. Create a user with user_id=alice.

curl --location 'http://0.0.0.0:4000/user/new' \
--header "Authorization: Bearer $LITELLM_MASTER_KEY" \
--header 'Content-Type: application/json' \
--data '{
"user_id": "alice"
}'

Step 2. Add the user to an existing team with max_budget_in_team.

curl -X POST 'http://0.0.0.0:4000/team/member_add' \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "e8d1460f-846c-45d7-9b43-55f3cc52ac32", "max_budget_in_team": 0.000000000001, "member": {"role": "user", "user_id": "alice"}}'

Step 3. Create a key for the team member with the same user_id and the team's team_id.

curl --location 'http://0.0.0.0:4000/key/generate' \
--header "Authorization: Bearer $LITELLM_MASTER_KEY" \
--header 'Content-Type: application/json' \
--data '{
"user_id": "alice",
"team_id": "e8d1460f-846c-45d7-9b43-55f3cc52ac32"
}'

Step 4. Make /chat/completions requests with that key. After the member's spend in the team reaches max_budget_in_team, requests fail with the member's budget_exceeded error.

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Authorization: Bearer <key-from-step-3>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-6-luna",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'

Check spend​

On the team's Members tab, Current Period Spend (USD) is the spend checked against each member's budget, Total Spend (USD) is their cumulative spend in the team, and Budget Period shows the dates the current period covers. The Team Member Budget (USD) column shows whether each member follows the Team default or has a Custom budget.

GET /team/info?team_id=<team_id> returns the same data in team_memberships. Each entry has spend, total_spend, the member's budget row in litellm_budget_table, and budget_source, which is team_default, custom or none.

Change or remove a budget​

Update a team member's budget​

Update max_budget_in_team for an existing team member with /team/member_update. The new budget takes effect on the member's next request.

This gives the member their own budget. It no longer follows the team's team_member_budget default, and later /team/update changes to that default leave this member untouched. To change the budget for every member still on the default, update team_member_budget on /team/update instead.

curl -X POST 'http://0.0.0.0:4000/team/member_update' \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "e8d1460f-846c-45d7-9b43-55f3cc52ac32", "user_id": "alice", "max_budget_in_team": 10}'

Spend the member already accrued in this team counts against the new budget. See Existing spend counts against a budget added later.

A budget change is permanent. When the member's budget_duration window rolls over, the reset only sets their current period spend back to $0 and moves the next reset date forward, so a raised max_budget_in_team stays at the new value in every later period and does not revert to the earlier amount or to the team default. Raising team_member_budget with /team/update behaves the same way for every member still on the team default.

When a member on the team default gets their own budget this way, their current reset window carries over and the next reset lands on the same date as before. Sending budget_duration in the same /team/member_update call starts a new window from that point instead.

To raise a member's budget for a limited time, send temp_budget_increase together with temp_budget_expiry on /team/member_update, or fill in the two temporary budget fields when editing the member in the Admin UI. See Temporary budget increase.

Put a member back on the team default​

Click Use team default next to a custom budget on the team's Members tab and confirm, or call POST /team/{team_id}/member/{user_id}/reset_budget. Their spend is kept and later /team/update changes to team_member_budget reach them again. Any rollover credit they earned on their custom budget is dropped. Since v1.104.0

To remove the default for the whole team, send "team_member_budget": null to /team/update. Members on the default then have no member cap, and members with their own budget keep it.

Reset a team member's spend​

Since v1.100.0

Reset the spend tracked against a member's in-team budget without changing the budget itself. This sets the member's current period spend, which is the value checked against their budget, and leaves their total spend and logs untouched. A proxy admin, or an admin of the team or its organization, can call it. Only a proxy admin can reset their own spend, so a team admin or org admin who targets themselves is refused.

  1. Go to Teams and open the team.
  2. Open the Members tab.
  3. In the member's row, click Reset spend in the Actions column.
  4. The Reset Team Member Spend dialog shows the member and their current period spend. Click Reset to set it to $0.

The buttons in the Actions column appear only for users who can edit the team. Reset spend is disabled on rows with no current period spend, and on a team admin's own row unless a proxy admin is signed in.

The reset takes effect on the member's next request, on every proxy instance. It applies to one member at a time and there is no bulk version, so repeat it for each member you want to reset.

Default budget​

team_member_budget is the default for one team's members, and there is no proxy-wide default for team members. Members added with /team/member_add are linked to the team's default, and setting a default on an existing team links every member who has no budget yet. A team without team_member_budget gives its members no cap of their own. See Default budgets.

Budget features​

Which budget features work on team member budgets. Each feature page lists every scope it supports.

FeatureSupportedDetails
Shared budgetsNoLiteLLM 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.
Default budgetsYesteam_member_budget and team_member_budget_duration on /team/new or /team/update, per team. There is no proxy-wide default.
Per-model budgetsYesteam_member_model_max_budget on /team/new or /team/update for every member, or model_max_budget on /team/member_update for one member.
Multiple budget windowsNoA member budget takes one budget_duration. Put windows on the member's keys instead.
Budget reset times and timezonesYesteam_member_budget_duration on the team, or budget_duration on /team/member_add or /team/member_update.
Budget rollover, overage carry-overYesCarries over for the member budget, measured against the base budget plus any credit.
Budget rollover, unused budget carry-overYesteam_member_rollover_max_budget on /team/new or /team/update, or Member Rollover Cap (USD) in the team's member defaults.
Soft budgets and budget alertsYesmetadata.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.
Team soft budget alertsNoUse metadata.team_member_max_budget_alert_emails on the team. See Soft budgets and budget alerts.
Budget exceeded errorsYesBudget has been exceeded! User=<user_id> in Team=<team_id>, or Budget has been exceeded! TeamMember=<user_id>:<team_id>
Throttle over-budget keysNoA member over their budget inside the team is rejected.
Budget fallbacksNoA member's per-model cap reroutes through the router fallbacks instead. See Reroute instead of rejecting.
Temporary budget increaseYestemp_budget_increase and temp_budget_expiry on /team/member_update, or Edit member on the team's Members tab in the Admin UI. Adds to the member's own budget, or to the team default when they are on it
Budget reservationYesHolds against the member's budget in the team, from max_budget_in_team or the team's team_member_budget.
Fail-closed budget enforcementYesgeneral_settings.fail_closed_budget_enforcement: true. A member who has a team member budget but no membership row is rejected with a 403 until a team admin adds them with /team/member_add.
Free models and budgetsYesThe member's budget in the team and the per-model caps a team sets for its members are not checked.
Self-serve budget changesNoA proxy admin, team admin or org admin sets member budgets with /team/member_update

Limits​

A member budget has one reset period, so it cannot take budget windows. Put windows on the member's keys instead. A member budget only counts team-scoped spend, so it does not cap the member's personal keys or their spend in other teams.

Team budgets covers the cap all members share, Budget rollover lets members carry unused allowance forward with team_member_rollover_max_budget, and Per-model budgets cap a member's spend on one model.