mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
Add HTTP-Referer and X-Title headers for OpenRouter
This commit is contained in:
parent
82079e644a
commit
287147687e
@ -459,6 +459,9 @@ async def generate_chat_completion(
|
|||||||
headers = {}
|
headers = {}
|
||||||
headers["Authorization"] = f"Bearer {key}"
|
headers["Authorization"] = f"Bearer {key}"
|
||||||
headers["Content-Type"] = "application/json"
|
headers["Content-Type"] = "application/json"
|
||||||
|
if "openrouter.ai" in app.state.config.OPENAI_API_BASE_URLS[idx]:
|
||||||
|
headers["HTTP-Referer"] = "https://openwebui.com/"
|
||||||
|
headers["X-Title"] = "Open WebUI"
|
||||||
|
|
||||||
r = None
|
r = None
|
||||||
session = None
|
session = None
|
||||||
|
Loading…
Reference in New Issue
Block a user