Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
28714768
Commit
28714768
authored
Jul 27, 2024
by
Alok Saboo
Browse files
Add HTTP-Referer and X-Title headers for OpenRouter
parent
82079e64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
backend/apps/openai/main.py
backend/apps/openai/main.py
+3
-0
No files found.
backend/apps/openai/main.py
View file @
28714768
...
@@ -459,6 +459,9 @@ async def generate_chat_completion(
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment