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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix use extra headers for open router
Ishaan Jaffdc3cdf3ed88f
diff --git a/litellm/main.py b/litellm/main.pyindex 1209306c8b0..789863ecb0e 100644--- a/litellm/main.py+++ b/litellm/main.py@@ -1856,17 +1856,18 @@ def completion()openrouter_site_url = get_secret("OR_SITE_URL") or "https://litellm.ai"-openrouter_app_name = get_secret("OR_APP_NAME") or "liteLLM"- headers = (- headers- or litellm.headers- or {- "HTTP-Referer": openrouter_site_url,- "X-Title": openrouter_app_name,- }- )+ openrouter_headers = {+ "HTTP-Referer": openrouter_site_url,+ "X-Title": openrouter_app_name,+ }++ _headers = headers or litellm.headers+ if _headers:+ openrouter_headers.update(_headers)++ headers = openrouter_headers## Load Configconfig = openrouter.OpenrouterConfig.get_config()