BerriAI/litellm · error · HTTPException

Key or team not found for the given identifier

Error message

Key or team not found for the given identifier

What it means

Error "Key or team not found for the given identifier" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/tool_management_endpoints.py:630

    )
    from litellm.proxy.proxy_server import prisma_client

    if prisma_client is None:
        raise HTTPException(status_code=500, detail=CommonProxyErrors.db_not_connected_error.value)

    try:
        if data.team_id is not None or data.key_hash is not None:
            if data.team_id is not None and data.key_hash is not None:
                raise HTTPException(
                    status_code=400,
                    detail="Provide either team_id or key_hash, not both",
                )
            if data.key_hash is not None:
                op_id = await _resolve_key_hash_to_object_permission_id(prisma_client, data.key_hash)
            else:
                op_id = await _resolve_team_id_to_object_permission_id(prisma_client, data.team_id or "")
            if op_id is None:
                raise HTTPException(
                    status_code=404,
                    detail="Key or team not found for the given identifier",
                )
            is_blocking: Final = data.input_policy == "blocked"
            if is_blocking:
                ok = await add_tool_to_object_permission_blocked(
                    prisma_client=prisma_client,
                    object_permission_id=op_id,
                    tool_name=data.tool_name,
                )
            else:
                ok = await remove_tool_from_object_permission_blocked(
                    prisma_client=prisma_client,
                    object_permission_id=op_id,
                    tool_name=data.tool_name,
                )
            if not ok:
                raise HTTPException(

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the team_id or key_hash identifies an existing team/key.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/tool_management_endpoints.py:630 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/6a18800e9c07423e. Report an issue: GitHub.