mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-25 02:26:33 +00:00
feat: Add support for custom OPENROUTER_API_BASE via get_secret in completion function
This commit is contained in:
+6
-1
@@ -2245,7 +2245,12 @@ def completion( # type: ignore # noqa: PLR0915
|
||||
additional_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
|
||||
|
||||
Reference in New Issue
Block a user