{"record":{"id":"1cdb2cd9deb5aaf0","repo":"BerriAI/litellm","slug":"custom-api-key-values-are-disabled-by-your-adminis","errorCode":null,"errorMessage":"Custom API key values are disabled by your administrator. Keys must be auto-generated.","messagePattern":"Custom API key values are disabled by your administrator\\. Keys must be auto-generated\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":240,"sourceCode":"\n\ndef _credentials_table(prisma_client: PrismaClient) -> _PrismaTableActions[CredentialItem]:\n    return CredentialsRepository(prisma_client).table\n\n\ndef _config_table(prisma_client: PrismaClient) -> _PrismaTableActions[ConfigParam]:\n    return ConfigRepository(prisma_client).table\n\n\nasync def _check_custom_key_allowed(custom_key_value: str | None) -> None:\n    \"\"\"Raise 403 if custom API keys are disabled and a custom key was provided.\"\"\"\n    if custom_key_value is None:\n        return\n\n    ui_settings: Final = await get_ui_settings_cached()\n    if ui_settings.get(\"disable_custom_api_keys\", False) is True:\n        verbose_proxy_logger.warning(\"Custom API key rejected: disable_custom_api_keys is enabled\")\n        raise HTTPException(\n            status_code=403,\n            detail={\"error\": \"Custom API key values are disabled by your administrator. Keys must be auto-generated.\"},\n        )\n\n\ndef _is_team_key(data: GenerateKeyRequest | LiteLLM_VerificationToken):\n    return data.team_id is not None\n\n\ndef _get_user_in_team(team_table: LiteLLM_TeamTableCachedObj, user_id: str | None) -> Member | None:\n    if user_id is None:\n        return None\n    for member in team_table.members_with_roles:\n        if member.user_id is not None and member.user_id == user_id:\n            return member\n\n    return None\n","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L222-L258","documentation":"Error \"Custom API key values are disabled by your administrator. Keys must be auto-generated.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:240 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Omit the custom 'key' value from the request and let the proxy auto-generate the key.","Ask your administrator to enable custom key values if you must set a specific key."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}