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]

fix(user_api_key_auth.py): fix client_ip

Krrish Dholakiae86cb90f9865
diff --git a/litellm/proxy/auth/user_api_key_auth.py b/litellm/proxy/auth/user_api_key_auth.py
index 5dd58466b9f..8d2c728f592 100644
--- a/litellm/proxy/auth/user_api_key_auth.py
+++ b/litellm/proxy/auth/user_api_key_auth.py
@@ -1275,6 +1275,8 @@ def _get_request_ip_address(
client_ip = request.headers["x-forwarded-for"]
elif request.client is not None:
client_ip = request.client.host
+ else:
+ client_ip = ""
return client_ip