Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: skip personal budget check in MaxBudgetLimiter for team-key requests

Yuneng Jiangc2b7c4bfcd25
diff --git a/litellm/proxy/hooks/max_budget_limiter.py b/litellm/proxy/hooks/max_budget_limiter.py
index 4df28acc542..7789fa6a349 100644
--- a/litellm/proxy/hooks/max_budget_limiter.py
+++ b/litellm/proxy/hooks/max_budget_limiter.py
@@ -27,6 +27,11 @@ class _PROXY_MaxBudgetLimiter(CustomLogger):
if max_budget is None or user_id is None:
return
+ # Personal budget applies only to non-team requests, matching
+ # the explicit team-key exemption in common_checks section 4.1.
+ if user_api_key_dict.team_id is not None:
+ return
+
from litellm.proxy.proxy_server import get_current_spend
curr_spend = await get_current_spend(