BerriAI/litellm · error · HTTPException

Team not found, passed team id: {team_id}.

Error message

Team not found, passed team id: {team_id}.

What it means

Error "Team not found, passed team id: {team_id}." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/team_endpoints.py:4145

                detail={
                    "error": "Database not connected. Connect a database to your proxy - https://docs.litellm.ai/docs/simple_proxy#managing-auth---virtual-keys"
                },
            )
        if team_id is None:
            raise HTTPException(
                status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
                detail={"message": "Malformed request. No team id passed in."},
            )

        try:
            team_info: BaseModel | None = await _team_db(prisma_client).find_unique(
                where={"team_id": team_id},
                include={"litellm_model_table": True, "object_permission": True},
            )
            if team_info is None:
                raise Exception
        except Exception:
            raise HTTPException(
                status_code=status.HTTP_404_NOT_FOUND,
                detail={"message": f"Team not found, passed team id: {team_id}."},
            )
        await validate_membership(
            user_api_key_dict=user_api_key_dict,
            team_table=LiteLLM_TeamTable.model_validate(team_info.model_dump()),
        )

        ## GET ALL KEYS ##
        keys = await prisma_client.get_data(
            team_id=team_id,
            table_name="key",
            query_type="find_all",
            expires=datetime.now(),
            limit=key_limit,
        )

        if keys is None:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the team id exists via /team/list or /team/info before calling this endpoint.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_endpoints.py:4145 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/5306f63ef7d4b834. Report an issue: GitHub.