BerriAI/litellm · error · HTTPException

Custom API key values are disabled by your administrator. Ke

Error message

Custom API key values are disabled by your administrator. Keys must be auto-generated.

What it means

Error "Custom API key values are disabled by your administrator. Keys must be auto-generated." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:240


def _credentials_table(prisma_client: PrismaClient) -> _PrismaTableActions[CredentialItem]:
    return CredentialsRepository(prisma_client).table


def _config_table(prisma_client: PrismaClient) -> _PrismaTableActions[ConfigParam]:
    return ConfigRepository(prisma_client).table


async def _check_custom_key_allowed(custom_key_value: str | None) -> None:
    """Raise 403 if custom API keys are disabled and a custom key was provided."""
    if custom_key_value is None:
        return

    ui_settings: Final = await get_ui_settings_cached()
    if ui_settings.get("disable_custom_api_keys", False) is True:
        verbose_proxy_logger.warning("Custom API key rejected: disable_custom_api_keys is enabled")
        raise HTTPException(
            status_code=403,
            detail={"error": "Custom API key values are disabled by your administrator. Keys must be auto-generated."},
        )


def _is_team_key(data: GenerateKeyRequest | LiteLLM_VerificationToken):
    return data.team_id is not None


def _get_user_in_team(team_table: LiteLLM_TeamTableCachedObj, user_id: str | None) -> Member | None:
    if user_id is None:
        return None
    for member in team_table.members_with_roles:
        if member.user_id is not None and member.user_id == user_id:
            return member

    return None

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Omit the custom 'key' value from the request and let the proxy auto-generate the key.
  2. Ask your administrator to enable custom key values if you must set a specific key.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:240 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/1cdb2cd9deb5aaf0. Report an issue: GitHub.