{"record":{"id":"a52af3983057f5f9","repo":"BerriAI/litellm","slug":"key-team-not-allowed-to-access-passthrough-route","errorCode":null,"errorMessage":"Key/team not allowed to access passthrough route {route}. Configure `allowed_passthrough_routes` on the team or key.","messagePattern":"Key/team not allowed to access passthrough route (.+?)\\. Configure `allowed_passthrough_routes` on the team or key\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/auth/route_checks.py","lineNumber":174,"sourceCode":"                        # read-only MCP-server discovery endpoints\n                        # (`/v1/mcp/server` and `/v1/mcp/server/{server_id}`)\n                        # so virtual keys with allowed_routes=[\"llm_api_routes\"]\n                        # can list/inspect MCP servers. The GET handlers in\n                        # mcp_management_endpoints.py sanitize the response\n                        # for restricted virtual keys (stripping url,\n                        # headers, env, credentials). POST/PUT/DELETE on\n                        # these paths are admin-only management writes and\n                        # are intentionally not covered.\n                        if RouteChecks._is_get_mcp_server_discovery_route(route=route, request=request):\n                            return True\n\n        # check if wildcard pattern is allowed\n        for allowed_route in valid_token.allowed_routes:\n            if RouteChecks._route_matches_wildcard_pattern(route=route, pattern=allowed_route):\n                return True\n\n        if denied_auth_enforced_pass_through_route:\n            raise RouteChecks._auth_pass_through_denied_exception(route=route)\n\n        raise HTTPException(\n            status_code=status.HTTP_403_FORBIDDEN,\n            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}\",\n        )\n\n    @staticmethod\n    def _mask_user_id(user_id: str) -> str:\n        \"\"\"\n        Mask user_id to prevent leaking sensitive information in error messages\n\n        Args:\n            user_id (str): The user_id to mask\n\n        Returns:\n            str: Masked user_id showing only first 2 and last 2 characters\n        \"\"\"\n        from litellm.litellm_core_utils.sensitive_data_masker import SensitiveDataMasker","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/auth/route_checks.py#L156-L192","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/auth/route_checks.py:174 when the library encounters an invalid state.","commonSituations":"A request hit a passthrough route that is not in the key's or team's allowed_passthrough_routes.","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."],"exampleFix":"Update the key: /key/update with allowed_passthrough_routes including the target route.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}