BerriAI/litellm · error · HTTPException
budget_limits cannot be set without specifying team_id when
Error message
budget_limits cannot be set without specifying team_id when using a CLI session token.
What it means
Error "budget_limits cannot be set without specifying team_id when using a CLI session token." thrown in BerriAI/litellm.
Source
Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:727
- A CLI session token caller may not set `budget_limits` on a personal
key (one with no `team_id`); mirrors the scalar `max_budget` guard in
`_common_key_generation_helper`.
- Non-admin callers may not set a window above their delegation ceiling.
"""
if not budget_limits:
return
non_finite: Final = next((w for w in budget_limits if not math.isfinite(w.max_budget)), None)
if non_finite is not None:
raise HTTPException(
status_code=400,
detail={"error": (f"budget_limits entry max_budget ({non_finite.max_budget}) must be a finite number.")},
)
if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value:
return
if is_ui_session_team_key:
return
if user_api_key_dict.is_session_token and team_table is None:
raise HTTPException(
status_code=400,
detail={
"error": ("budget_limits cannot be set without specifying team_id when using a CLI session token.")
},
)
if delegation_ceiling is None:
return
over_ceiling: Final = next((w for w in budget_limits if w.max_budget > delegation_ceiling), None)
if over_ceiling is not None:
raise HTTPException(
status_code=400,
detail={
"error": (
f"budget_limits entry max_budget ({over_ceiling.max_budget}) "
f"cannot exceed the caller's own max_budget ({delegation_ceiling})."
)
},
)View on GitHub (pinned to 77b7c6c40c)
Solutions
- Include team_id in the request when setting budget_limits with a CLI session token.
- Use a regular virtual key instead of a CLI session token to set budget_limits without a team.
When it happens
Trigger: Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:727 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/a63f7b278a84f679.
Report an issue: GitHub.