Throttle over-budget keys
A key that reaches its max_budget is normally rejected with a budget_exceeded error until the budget resets or someone raises it. With throttling turned on, the key keeps serving after its budget runs out, at a fraction of its TPM and RPM limits, so the workload behind it slows down instead of stopping.
Two settings work together. throttle_on_budget_exceeded: true on the key opts it in, and only a proxy admin can turn it on. litellm_settings.budget_exceeded_throttle_percentage is the fraction of the key's tpm_limit and rpm_limit that an over-budget key keeps, greater than 0 and at most 1. Spend keeps counting while the key is throttled, so the key can end its budget window above its max_budget.
How it works
LiteLLM makes this decision on every request while it authenticates it. Below the cap nothing changes, so throttling never slows a key before its budget runs out. Over the cap, the key's limits are scaled for that one request from the values stored on the key, so repeated requests do not compound the reduction. A scaled limit that would round down to 0 becomes 1. Team, organization, user and every other budget the request falls under are checked as usual, and any of them that has run out still rejects the request.
When to use it
Turn it on for keys whose owners would rather degrade than go dark when a monthly cap runs out. A customer-facing support bot can keep answering at 10 percent of its normal rate until someone approves more budget, where a hard stop would take the feature offline. A shared coding assistant key can slow down late in the month instead of locking out a whole team mid-task. Throttling also buys time to react to a budget alert, since the owner hears about the overrun while traffic is still trickling through.
Leave it off when the budget is a real spending ceiling, such as a customer's prepaid allowance or a cap finance holds you to, because a throttled key keeps spending past max_budget. To give one key more room for a while, use a temporary budget increase. To move a key to a cheaper model once a per-model cap runs out, use budget fallbacks. To slow a key down at all times, set rate limits on it.
Supported scopes
| Scope | Supported | How to set it |
|---|---|---|
| Whole proxy | No | The proxy-wide max_budget still rejects every request once it runs out. |
| Organization | No | An organization over its budget rejects the request, even when the key itself is throttled. |
| Team | No | A team over its budget rejects the request. Team rate limits are never scaled. |
| Team member | No | A member over their budget inside the team is rejected. |
| Project | No | A project over its budget rejects the request. |
| Virtual key | Yes | throttle_on_budget_exceeded: true on /key/generate or /key/update, plus litellm_settings.budget_exceeded_throttle_percentage. Covers the key's own max_budget only. A budget_limits window or a per-model budget on the key still rejects. |
| Internal user | No | A user over their personal budget is rejected. |
| Customer | No | A customer over their budget is rejected. |
| Tag | No | A tag over its budget rejects the request. |
| Model access group | No | A model access group over its budget rejects the request. |
| AI tool | No | An AI tool over its budget rejects the request. |
| Agent session | No | A session over max_budget_per_session returns its own 429. |
How to use it
Set the percentage
The percentage is one proxy-wide value that applies to every key that opts in. Set it under litellm_settings:
litellm_settings:
budget_exceeded_throttle_percentage: 0.1
With 0.1, an over-budget key with rpm_limit: 600 and tpm_limit: 200000 keeps 60 requests and 20,000 tokens per minute. In the Admin UI, set it under Settings, Router Settings. Leaving it unset, or setting a value that is 0, negative or above 1, turns throttling off, and every over-budget key is rejected.
Turn it on for a key
The key needs a max_budget and at least one of tpm_limit or rpm_limit. Only a proxy admin can turn throttle_on_budget_exceeded on, and anyone else who tries gets a 403.
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": "support-bot",
"max_budget": 500,
"budget_duration": "1mo",
"rpm_limit": 600,
"tpm_limit": 200000,
"throttle_on_budget_exceeded": true
}'
To turn it on for an existing key, send the same field to /key/update:
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-...", "throttle_on_budget_exceeded": true}'
Send "throttle_on_budget_exceeded": false to turn it off. Anyone who may otherwise update the key can turn it off. In the Admin UI, the Throttle on budget exceeded switch is under Optional Settings when you create a key, and in the key's edit form afterwards.
Check it
/key/info returns the flag as metadata.throttle_on_budget_exceeded, alongside the key's spend and max_budget. Once the key is over budget, a request above the reduced limit gets the usual rate limit 429, whose message reports the reduced limit. The x-litellm-key-rpm-limit and x-litellm-key-tpm-limit response headers keep showing the limits stored on the key, not the reduced ones.
Limits
Throttling only scales the key's own tpm_limit and rpm_limit. A key that has only one of them is slowed on that one, and the other stays unlimited. max_parallel_requests, per-model limits on the key such as model_rpm_limit, and team, user and customer rate limits are not scaled.
A percentage of 1 keeps an over-budget key at full speed with no spend limit at all, so pick a value well below 1. The throttle lifts on its own when the key's spend resets at its budget_duration, or as soon as you raise max_budget above the current spend.
Over-budget spend is real spend. It shows in /key/info and counts toward the key's team, organization and other budgets, and budget alerts keep firing on their usual schedule.
Related
See Budget exceeded errors for what a rejected key receives, Rate limits for the limits that throttling scales, and Budgets and spend limits for every scope a request is checked against.