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
feat: Add support for custom OPENROUTER_API_BASE via get_secret in completion function
Grayson Chenf3a0261bb48e
diff --git a/litellm/main.py b/litellm/main.pyindex 64049c31d12..fcf711d2dd4 100644--- a/litellm/main.py+++ b/litellm/main.py@@ -2245,7 +2245,12 @@ def completion( # type: ignore # noqa: PLR0915additional_args={"headers": headers},)elif custom_llm_provider == "openrouter":- api_base = api_base or litellm.api_base or "https://openrouter.ai/api/v1"+ api_base = (+ api_base+ or litellm.api_base+ or get_secret("OPENROUTER_API_BASE")+ or "https://openrouter.ai/api/v1"+ )api_key = (api_key