Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

use get_request_route

Ishaan Jaff35dde9d2a801
diff --git a/litellm/proxy/auth/user_api_key_auth.py b/litellm/proxy/auth/user_api_key_auth.py
index b8be226050d..1192490422a 100644
--- a/litellm/proxy/auth/user_api_key_auth.py
+++ b/litellm/proxy/auth/user_api_key_auth.py
@@ -58,6 +58,7 @@ from litellm.proxy.auth.auth_checks import (
)
from litellm.proxy.auth.auth_utils import (
check_if_request_size_is_safe,
+ get_request_route,
is_llm_api_route,
route_in_additonal_public_routes,
)
@@ -115,7 +116,7 @@ async def user_api_key_auth(
)
try:
- route: str = request.url.path
+ route: str = get_request_route(request=request)
### LiteLLM Enterprise Security Checks
# Check 1. Check if request size is under max_request_size_mb