What this thread does
Do first: On an existing database-backed proxy, submit per-key limits to POST /key/generate; a cumulative dollar budget and per-minute token rate are different controls.
Short answer
Use tpm_limit for tokens/minute, rpm_limit for requests/minute and max_parallel_requests for concurrency. Use max_budget for USD spend, with budget_duration to reset it. Budgets need Postgres; a deployment without a database does not enforce them.
What to do
The docs' rate-limit JSON body for /key/generate is:
{"max_parallel_requests": 10, "tpm_limit": 20, "rpm_limit": 4}
| Need | Field / documented value |
|---|---|
| Spend ceiling | max_budget: default null, so no key budget check; documented example 10 USD |
| Spend reset | budget_duration: absent means never reset; accepted examples 30s, 30m, 30h, 30d |
| Key expiration | duration, separately from budget reset; upperbound example 30d |
| Rate limits | Optional integer tpm_limit, rpm_limit, max_parallel_requests; defaults None unless configured |
| Token accounting | In config.yaml, general_settings.token_rate_limit_type: total (default, input + output), input, output; applies globally |
| Multiple spend windows | budget_limits: list of {budget_duration, max_budget} objects; example 24h / 10 USD and 30d / 100 USD |
| Window resets | 1h: hourly; 24h: midnight UTC; 7d: Monday midnight UTC or configured reset time; 30d: first of month midnight UTC |
| Inspect key spend | /key/info; key spend is in USD |
| Update a key | /key/update; budget changes normally require proxy, team or organization admin |
To set generation ceilings in config.yaml, use litellm_settings.upperbound_key_generate_params. The page's example is max_budget: 100, budget_duration: "10d", duration: "30d", with max_parallel_requests, tpm_limit, rpm_limit each 1000. A request for max_budget=200 is rejected with HTTP 400, including max_budget is over max limit set in config - user_value=200; max_value=100; values are not clamped. Omitted or null budget duration inherits the upperbound 10d.
litellm_settings.default_key_generate_params supplies defaults instead. Explicit "budget_duration": null skips that default for a non-resetting budget; an upperbound still applies.
Limits and open questions
These are key limits; the owner's tpm_limit and rpm_limit also apply when set. For a team key, personal owner budgets stopped applying in v1.95.0; v1.94.0 briefly enforced them with skip_user_budget_on_team_key, and both that behavior and flag were removed in v1.95.0. Team/member budgets remain relevant. A key crossing its spend budget is rejected; the documented diagnostic includes ExceededTokenBudget: Current spend for token. TPM reservation precedes a call and is reconciled with actual usage afterward; omitting max_tokens / max_completion_tokens requires an output-token estimate. Across instances, counters use Redis via general_settings.coordination_redis or REDIS_*. Default outage behavior serves against per-instance counters, which can exceed the aggregate limit. Set general_settings.fail_closed_rate_limit_enforcement: true to reject requests needing unavailable Redis counters with 503, distinct from rate-limit 429; default is off. It has no effect without Redis, and LEGACY_MULTI_INSTANCE_RATE_LIMITING=true ignores it. The pages give no release date for the basic per-key settings and do not present TPM as a lifetime token allowance.
Not for: PydanticAI UsageLimits inside a single agent run or LiteLLM customer budgets.
Sources
Checked
2026-11-17; read Virtual Keys; Budgets, Rate Limits; no command was run.
Started from a post by @BerriAI, packaged by the editor. Original post