BerriAI/litellm · error · HTTPException

At least one of team_id or key_hash is required to identify

Error message

At least one of team_id or key_hash is required to identify the override

What it means

Error "At least one of team_id or key_hash is required to identify the override" thrown in BerriAI/litellm.

Source

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

    tool_name: str,
    team_id: str | None = Query(None, description="Team ID of the override to remove"),
    key_hash: str | None = Query(None, description="Key hash of the override to remove"),
    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
    """
    Remove a policy override for a tool. Specify the override by team_id or key_hash
    (exactly one required).
    """
    from litellm.proxy.db.tool_registry_writer import (
        get_tool_policy_registry,
        remove_tool_from_object_permission_blocked,
    )
    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)
    if team_id is None and key_hash is None:
        raise HTTPException(
            status_code=400,
            detail="At least one of team_id or key_hash is required to identify the override",
        )
    if team_id is not None and key_hash is not None:
        raise HTTPException(
            status_code=400,
            detail="Provide either team_id or key_hash, not both",
        )
    try:
        if key_hash is not None:
            op_id = await _resolve_key_hash_to_object_permission_id(prisma_client, key_hash)
        else:
            op_id = await _resolve_team_id_to_object_permission_id(prisma_client, team_id or "")
        if op_id is None:
            raise HTTPException(
                status_code=404,
                detail="Key or team not found for the given identifier",
            )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide team_id or key_hash to identify which override to delete.

When it happens

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