BerriAI/litellm · error · HTTPException

team_id is required for service account keys. Please specify

Error message

team_id is required for service account keys. Please specify `team_id` in the request body.

What it means

Error "team_id is required for service account keys. Please specify `team_id` in the request body." thrown in BerriAI/litellm.

Source

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

            status_code=400,
            detail={
                "error": (
                    f"budget_limits entry max_budget ({over_ceiling.max_budget}) "
                    f"cannot exceed the caller's own max_budget ({delegation_ceiling})."
                )
            },
        )


async def validate_team_id_used_in_service_account_request(
    team_id: str | None,
    prisma_client: PrismaClient | None,
):
    """
    Validate team_id is used in the request body for generating a service account key
    """
    if team_id is None:
        raise HTTPException(
            status_code=400,
            detail="team_id is required for service account keys. Please specify `team_id` in the request body.",
        )

    if prisma_client is None:
        raise HTTPException(
            status_code=400,
            detail="prisma_client is required for service account keys. Please specify `prisma_client` in the request body.",
        )

    # check if team_id exists in the database
    team: Final = await _prisma_table(TeamRepository(prisma_client)).find_unique(
        where={"team_id": team_id},
    )
    if team is None:
        raise HTTPException(
            status_code=400,
            detail="team_id does not exist in the database. Please specify a valid `team_id` in the request body.",

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Include a valid team_id in the request body for the service account key.
  2. Create a regular user-bound key instead if no team is involved.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:756 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/8350cac4b9bada98. Report an issue: GitHub.