BerriAI/litellm · error · HTTPException
User does not belong to Team= {team_id}. Call `/user/info` t
Error message
User does not belong to Team= {team_id}. Call `/user/info` to see user's teams What it means
Error "User does not belong to Team= {team_id}. Call `/user/info` to see user's teams" thrown in BerriAI/litellm.
Source
Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5754
user_id_upsert=False,
user_api_key_cache=user_api_key_cache,
parent_otel_span=user_api_key_dict.parent_otel_span,
proxy_logging_obj=proxy_logging_obj,
check_db_only=True,
)
if user_info is None:
raise HTTPException(
status_code=404,
detail={"error": f"User= {user_api_key_dict.user_id} not found"},
)
if team_ids_list is None:
team_ids_list = user_info.teams
else:
# check if all team_ids are in user_info.teams
for team_id in team_ids_list:
if team_id not in user_info.teams:
raise HTTPException(
status_code=404,
detail={
"error": f"User does not belong to Team= {team_id}. Call `/user/info` to see user's teams"
},
)
## Fetch team aliases and check team admin status
where_condition: Final[_TeamIdInFilter] = {}
if team_ids_list:
where_condition["team_id"] = {"in": list(team_ids_list)}
team_aliases: Final = await _team_db(prisma_client).find_many(where=where_condition)
team_alias_metadata: Final = {t.team_id: {"team_alias": _as_object(t.team_alias)} for t in team_aliases}
# Check if user is team admin or has /team/daily/activity permission
# If not, filter by user's API keys.
#
# Earlier this loop used `any-team admin -> set has_full_team_view=True
# for the entire request`, so an admin of one team that requestedView on GitHub (pinned to 77b7c6c40c)
Solutions
- Call /user/info to see the user's teams, and use a team_id the user actually belongs to.
When it happens
Trigger: Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5754 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/b420ff505b1b19e3.
Report an issue: GitHub.