BerriAI/litellm · error · ProxyException

Key Hash not found.

Error message

Key Hash not found.

What it means

Error "Key Hash not found." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:5318

        if complete_user_info.organization_memberships is None or organization_id not in [
            membership.organization_id for membership in complete_user_info.organization_memberships
        ]:
            raise ProxyException(
                message="You are not authorized to check this organization's keys",
                type=ProxyErrorTypes.bad_request_error,
                param="organization_id",
                code=status.HTTP_403_FORBIDDEN,
            )

    if key_hash:
        try:
            key_info: Final[LiteLLM_VerificationToken] = await VerificationTokenRepository(
                prisma_client
            ).table.find_unique(
                where={"token": key_hash},
            )
        except Exception:
            raise ProxyException(
                message="Key Hash not found.",
                type=ProxyErrorTypes.bad_request_error,
                param="key_hash",
                code=status.HTTP_403_FORBIDDEN,
            )
        can_user_query_key_info: Final = await _can_user_query_key_info(
            user_api_key_dict=user_api_key_dict,
            key=key_hash,
            key_info=key_info,
        )
        if not can_user_query_key_info:
            raise HTTPException(
                status_code=status.HTTP_403_FORBIDDEN,
                detail=f"You are not allowed to access this key's info. Your role={user_api_key_dict.user_role}",
            )
    return complete_user_info

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the key hash is correct and the key exists via /key/list.
  2. Use the full key value instead of the hash if the endpoint accepts it.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:5318 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/50967ec97a477a24. Report an issue: GitHub.