BerriAI/litellm · error · HTTPException

User not allowed to give access to all models. Select models

Error message

User not allowed to give access to all models. Select models you want org to have access to.

What it means

Scope-narrowing guard on org creation: the caller's key restricts them to a specific model list (user_api_key_dict.models is non-empty) but the request carries an empty models list, which would grant the org all models — an escalation the caller is not entitled to. Callers with unrestricted keys may pass an empty list.

Source

Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:468

            }
        )

        data.budget_id = _budget.budget_id

    ## Handle Object Permission - MCP, Vector Stores etc.
    object_permission_id: Final = await _set_object_permission(
        data=data,
        prisma_client=prisma_client,
    )

    """
    Ensure only models that user has access to, are given to org
    """
    if len(user_api_key_dict.models) == 0:  # user has access to all models
        pass
    else:
        if len(data.models) == 0:
            raise HTTPException(
                status_code=400,
                detail={
                    "error": "User not allowed to give access to all models. Select models you want org to have access to."
                },
            )

        for m in data.models:
            await can_user_call_model(m, llm_router=llm_router, user_object=user_object_correct_type)

    organization_row: Final = LiteLLM_OrganizationTable(
        **data.json(exclude_none=True),
        object_permission_id=object_permission_id,
        created_by=user_api_key_dict.user_id or litellm_proxy_admin_name,
        updated_by=user_api_key_dict.user_id or litellm_proxy_admin_name,
    )

    for field in LiteLLM_ManagementEndpoint_MetadataFields:
        if getattr(data, field, None) is not None:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Select the specific models the org should access instead of granting all models.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:468 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/db86f7150f31311e. Report an issue: GitHub.