BerriAI/litellm · error · ProxyException

Master Key not set for Proxy. Please set Master Key to use A

Error message

Master Key not set for Proxy. Please set Master Key to use Admin UI. Set `LITELLM_MASTER_KEY` in .env or set general_settings:master_key in config.yaml.  https://docs.litellm.ai/docs/proxy/virtual_keys. If set, use `--detailed_debug` to debug issue.

What it means

Error "Master Key not set for Proxy. Please set Master Key to use Admin UI. Set `LITELLM_MASTER_KEY` in .env or set general_settings:master_key in config.yaml. https://docs.litellm.ai/docs/proxy/virtual_keys. If set, use `--detailed_debug` to debug issue." thrown in BerriAI/litellm.

Source

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

        sso_jwt_handler = JWTHandler()
        sso_jwt_handler.update_environment(
            prisma_client=prisma_client,
            user_api_key_cache=user_api_key_cache,
            litellm_jwtauth=LiteLLM_JWTAuth(
                team_ids_jwt_field=general_settings.get("ui_access_mode", {}).get("sso_group_jwt_field", None),
            ),
            leeway=0,
        )

    microsoft_client_id: Final = os.getenv("MICROSOFT_CLIENT_ID", None)
    google_client_id: Final = os.getenv("GOOGLE_CLIENT_ID", None)
    generic_client_id: Final = os.getenv("GENERIC_CLIENT_ID", None)
    received_response: dict | None = None
    access_token_payload: dict | None = None
    sso_assertion: SSOIdentityAssertion | None = None
    # get url from request
    if master_key is None:
        raise ProxyException(
            message="Master Key not set for Proxy. Please set Master Key to use Admin UI. Set `LITELLM_MASTER_KEY` in .env or set general_settings:master_key in config.yaml.  https://docs.litellm.ai/docs/proxy/virtual_keys. If set, use `--detailed_debug` to debug issue.",
            type=ProxyErrorTypes.auth_error,
            param="master_key",
            code=status.HTTP_500_INTERNAL_SERVER_ERROR,
        )
    redirect_url = SSOAuthenticationHandler.get_redirect_url_for_sso(request=request, sso_callback_route="sso/callback")

    verbose_proxy_logger.info("Redirecting to %s", redirect_url)
    result = None
    if google_client_id is not None:
        result = await GoogleSSOHandler.get_google_callback_response(
            request=request,
            google_client_id=google_client_id,
            redirect_url=redirect_url,
        )
    elif microsoft_client_id is not None:
        result = await MicrosoftSSOHandler.get_microsoft_callback_response(
            request=request,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set LITELLM_MASTER_KEY in .env or general_settings:master_key in config.yaml, then restart; use --detailed_debug if already set.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/ui_sso.py:2020 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/554f228512908f15. Report an issue: GitHub.