BerriAI/litellm · error · HTTPException
Key/team not allowed to access passthrough route {route}. Co
Error message
Key/team not allowed to access passthrough route {route}. Configure `allowed_passthrough_routes` on the team or key. What it means
Route authorization for passthrough endpoints: the key/team's allowed_passthrough_routes does not include this route, so raw passthrough to the upstream provider is denied to prevent unlogged/unauthorized API access.
Source
Thrown at litellm/proxy/auth/route_checks.py:174
# read-only MCP-server discovery endpoints
# (`/v1/mcp/server` and `/v1/mcp/server/{server_id}`)
# so virtual keys with allowed_routes=["llm_api_routes"]
# can list/inspect MCP servers. The GET handlers in
# mcp_management_endpoints.py sanitize the response
# for restricted virtual keys (stripping url,
# headers, env, credentials). POST/PUT/DELETE on
# these paths are admin-only management writes and
# are intentionally not covered.
if RouteChecks._is_get_mcp_server_discovery_route(route=route, request=request):
return True
# check if wildcard pattern is allowed
for allowed_route in valid_token.allowed_routes:
if RouteChecks._route_matches_wildcard_pattern(route=route, pattern=allowed_route):
return True
if denied_auth_enforced_pass_through_route:
raise RouteChecks._auth_pass_through_denied_exception(route=route)
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail=f"Virtual key is not allowed to call this route. Only allowed to call routes: {valid_token.allowed_routes}. Tried to call route: {route}",
)
@staticmethod
def _mask_user_id(user_id: str) -> str:
"""
Mask user_id to prevent leaking sensitive information in error messages
Args:
user_id (str): The user_id to mask
Returns:
str: Masked user_id showing only first 2 and last 2 characters
"""
from litellm.litellm_core_utils.sensitive_data_masker import SensitiveDataMaskerView on GitHub (pinned to 77b7c6c40c)
Solutions
- Add the route to allowed_passthrough_routes on the team or key configuration.
- Use a key/team that already has this passthrough route allowed.
Example fix
Update the key: /key/update with allowed_passthrough_routes including the target route.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/auth/route_checks.py:174 when the library encounters an invalid state.
Common situations: A request hit a passthrough route that is not in the key's or team's allowed_passthrough_routes.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/a52af3983057f5f9.
Report an issue: GitHub.