BerriAI/litellm · error · HTTPException

Only proxy admins can update UI settings.

Error message

Only proxy admins can update UI settings.

What it means

Role gate on PATCH /update/ui_settings: the caller's user_role is not PROXY_ADMIN. UI configuration flags are proxy-wide admin concerns, so non-admin keys are rejected with 403 before any body parsing or persistence happens.

Source

Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:1431

    tags=["UI Settings"],
    dependencies=[Depends(user_api_key_auth)],
)
async def update_ui_settings(
    settings_body: dict[str, object] = Body(...),
    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
    """
    Update UI-specific configuration flags.
    Only proxy admins are allowed to modify these settings.
    """
    from litellm.proxy.proxy_server import (
        create_config_audit_log,
        prisma_client,
        store_model_in_db,
    )

    if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:
        raise HTTPException(status_code=403, detail="Only proxy admins can update UI settings.")

    if prisma_client is None:
        raise HTTPException(
            status_code=500,
            detail={"error": "Database not connected. Please connect a database."},
        )

    if store_model_in_db is not True:
        raise HTTPException(
            status_code=500,
            detail={"error": "Set `'STORE_MODEL_IN_DB='True'` in your env to enable this feature."},
        )

    conflicting_keys: Final = sorted(
        key
        for key, value in settings_body.items()
        if key in _DERIVED_UI_SETTINGS_FIELDS and value != _derived_ui_setting_value(key)
    )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use a proxy admin key to update UI settings.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:1431 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/2898638583c11a46. Report an issue: GitHub.