From 9a4cfc404bf496c61493861be05759f1252f1449 Mon Sep 17 00:00:00 2001 From: rahul dhanawade Date: Thu, 5 Feb 2026 23:15:34 +0530 Subject: [PATCH] Add ProxyAuthenticationException for proxy unauth 401s --- litellm/proxy/_types.py | 6 ++++++ litellm/proxy/auth/auth_checks.py | 1 + 2 files changed, 7 insertions(+) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 131a6caab07..b606af4c30f 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -3000,6 +3000,12 @@ class ProxyException(Exception): error_dict["provider_specific_fields"] = self.provider_specific_fields return error_dict +class ProxyAuthenticationException(ProxyException): + """ + Expected auth error (401) for invalid or missing proxy token. + Logged as unauthenticated, not as an internal crash. + """ + pass class CommonProxyErrors(str, enum.Enum): db_not_connected_error = ( diff --git a/litellm/proxy/auth/auth_checks.py b/litellm/proxy/auth/auth_checks.py index 359bb944546..1638f93e75d 100644 --- a/litellm/proxy/auth/auth_checks.py +++ b/litellm/proxy/auth/auth_checks.py @@ -48,6 +48,7 @@ from litellm.proxy._types import ( LitellmUserRoles, NewTeamRequest, ProxyErrorTypes, + ProxyAuthenticationException, ProxyException, RoleBasedPermissions, SpecialModelNames,