Unverified Commit 2e4de209 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #4149 from arsaboo/openrouter

chore: Add HTTP-Referer and X-Title headers for OpenRouter
parents 1aaa2e82 28714768
...@@ -462,6 +462,9 @@ async def generate_chat_completion( ...@@ -462,6 +462,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
......
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