From 0e3489e1db42d45b1a9debe855629a390c8399d6 Mon Sep 17 00:00:00 2001 From: PRABHU KIRAN VANDRANKI <72809214+VANDRANKI@users.noreply.github.com> Date: Mon, 18 May 2026 15:11:25 -0400 Subject: [PATCH] fix: use >= in _team_max_budget_check to match all other budget checks The team max-budget guard used strict `>` (spend > max_budget) while every other budget check in auth_checks.py uses `>=`: - _virtual_key_max_budget_check: spend >= max_budget - team member budget check: spend >= team_member_budget - org budget check: spend >= org_max_budget With `>`, a team at exactly its budget limit is not blocked. Setting max_budget=0 as a hard block has no effect for teams (0 > 0 is False) while working correctly for keys (0 >= 0 is True). One character change to fix the off-by-one. --- litellm/proxy/auth/auth_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/auth/auth_checks.py b/litellm/proxy/auth/auth_checks.py index 13381c7a6c9..21e609d36d4 100644 --- a/litellm/proxy/auth/auth_checks.py +++ b/litellm/proxy/auth/auth_checks.py @@ -3694,7 +3694,7 @@ async def _team_max_budget_check( fallback_spend=team_object.spend or 0.0, ) - if math.isfinite(team_object.max_budget) and spend > team_object.max_budget: + if math.isfinite(team_object.max_budget) and spend >= team_object.max_budget: if valid_token: call_info = CallInfo( token=valid_token.token,