"src/lib/vscode:/vscode.git/clone" did not exist on "85187deb4b96d88366ea43530a9fe6e9983dc5dc"
Commit 28714768 authored by Alok Saboo's avatar Alok Saboo
Browse files

Add HTTP-Referer and X-Title headers for OpenRouter

parent 82079e64
......@@ -459,6 +459,9 @@ async def generate_chat_completion(
headers = {}
headers["Authorization"] = f"Bearer {key}"
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
session = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment