BerriAI/litellm · error · HTTPException

Model not in allowed user models. User allowed models={user_

Error message

Model not in allowed user models. User allowed models={user_api_key_dict.models}. User id={user_api_key_dict.user_id}

What it means

Model allowlist check for standalone team creation: every requested model must be in the caller's allowed models; requesting a model outside user_api_key_dict.models is refused with 400 naming the user's allowed set and id.

Source

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

            user_id=user_api_key_dict.user_id,
            prisma_client=prisma_client,
            user_api_key_cache=user_api_key_cache,
            user_id_upsert=False,
        )

        if user_obj is not None and user_obj.max_budget is not None and data.max_budget > user_obj.max_budget:
            raise HTTPException(
                status_code=400,
                detail={
                    "error": f"max budget higher than user max. User max budget={user_obj.max_budget}. User role={user_api_key_dict.user_role}"
                },
            )

    # Validate team models against user's allowed models
    if data.models is not None and len(user_api_key_dict.models) > 0:
        for m in data.models:
            if m not in user_api_key_dict.models:
                raise HTTPException(
                    status_code=400,
                    detail={
                        "error": f"Model not in allowed user models. User allowed models={user_api_key_dict.models}. User id={user_api_key_dict.user_id}"
                    },
                )

    # Validate team TPM/RPM against user's TPM/RPM limits
    if (
        data.tpm_limit is not None
        and user_api_key_dict.tpm_limit is not None
        and data.tpm_limit > user_api_key_dict.tpm_limit
    ):
        raise HTTPException(
            status_code=400,
            detail={
                "error": f"tpm limit higher than user max. User tpm limit={user_api_key_dict.tpm_limit}. User role={user_api_key_dict.user_role}"
            },
        )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Only grant models within your key's allowed models list.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1067 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/51cd24c703345b40. Report an issue: GitHub.