BerriAI/litellm · error · ProxyException

Master Key not set for Proxy. Set `LITELLM_MASTER_KEY` in .e

Error message

Master Key not set for Proxy. Set `LITELLM_MASTER_KEY` in .env or general_settings:master_key in config.yaml.

What it means

Error "Master Key not set for Proxy. Set `LITELLM_MASTER_KEY` in .env or general_settings:master_key in config.yaml." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/ui_sso.py:2136

async def saml_callback(request: Request):
    """Assertion Consumer Service. Validates the IdP assertion and issues a UI session."""
    from litellm.proxy.proxy_server import (
        general_settings,
        jwt_handler,
        master_key,
        premium_user,
        prisma_client,
        user_api_key_cache,
    )

    _disable_ui_flag: Final = os.getenv("DISABLE_ADMIN_UI")
    if _disable_ui_flag is not None and str_to_bool(value=_disable_ui_flag):
        return admin_ui_disabled()

    if prisma_client is None:
        raise HTTPException(status_code=500, detail=CommonProxyErrors.db_not_connected_error.value)
    if master_key is None:
        raise ProxyException(
            message="Master Key not set for Proxy. Set `LITELLM_MASTER_KEY` in .env or general_settings:master_key in config.yaml.",
            type=ProxyErrorTypes.auth_error,
            param="master_key",
            code=status.HTTP_500_INTERNAL_SERVER_ERROR,
        )

    post_data: Final = await SAMLAuthHandler.read_acs_post_data(request)
    if "SAMLResponse" not in post_data:
        raise HTTPException(status_code=400, detail="Missing SAMLResponse in callback request.")

    result: Final = await SAMLAuthHandler.handle_acs(request=request, cache=user_api_key_cache, post_data=post_data)

    await _raise_if_sso_exceeds_free_user_limit(premium_user, prisma_client)

    ui_access_mode: Final = general_settings.get("ui_access_mode", None)
    relay_state: Final = post_data.get("RelayState")
    cp_return_to: Final[str | None] = (
        relay_state

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set LITELLM_MASTER_KEY in .env or general_settings:master_key in config.yaml, then restart.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/ui_sso.py:2136 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/52a7854454224f4c. Report an issue: GitHub.