{"record":{"id":"bba23562d58f39d8","repo":"BerriAI/litellm","slug":"you-are-not-authorized-to-check-another-user-s-key","errorCode":null,"errorMessage":"You are not authorized to check another user's keys","messagePattern":"You are not authorized to check another user's keys","errorType":"http","errorClass":"ProxyException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":5283,"sourceCode":"    complete_user_info_db_obj: Final[BaseModel | None] = await _prisma_table(UserRepository(prisma_client)).find_unique(\n        where={\"user_id\": user_api_key_dict.user_id},\n        include={\"organization_memberships\": True},\n    )\n\n    if complete_user_info_db_obj is None:\n        raise ProxyException(\n            message=\"You are not authorized to access this endpoint. No 'user_id' is associated with your API key.\",\n            type=ProxyErrorTypes.bad_request_error,\n            param=\"user_id\",\n            code=status.HTTP_403_FORBIDDEN,\n        )\n\n    complete_user_info: Final = LiteLLM_UserTable.model_validate(complete_user_info_db_obj.model_dump())\n\n    # internal user can only see their own keys\n    if user_id:\n        if complete_user_info.user_id != user_id:\n            raise ProxyException(\n                message=\"You are not authorized to check another user's keys\",\n                type=ProxyErrorTypes.bad_request_error,\n                param=\"user_id\",\n                code=status.HTTP_403_FORBIDDEN,\n            )\n\n    if team_id:\n        if team_id not in complete_user_info.teams:\n            raise ProxyException(\n                message=\"You are not authorized to check this team's keys\",\n                type=ProxyErrorTypes.bad_request_error,\n                param=\"team_id\",\n                code=status.HTTP_403_FORBIDDEN,\n            )\n\n    if organization_id:\n        if complete_user_info.organization_memberships is None or organization_id not in [\n            membership.organization_id for membership in complete_user_info.organization_memberships","sourceCodeStart":5265,"sourceCodeEnd":5301,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L5265-L5301","documentation":"Error \"You are not authorized to check another user's keys\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:5283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Query only your own keys, or authenticate with a proxy admin key.","Ask a proxy admin to check the other user's keys."],"exampleFix":null,"handlingStrategy":null,"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"}