open-webui/backend
Alejandro García Iglesias 823a205fd2 feat: interpolate template variables in custom connection headers
Admins can now use {{chat_id}}, {{message_id}}, {{user_id}}, and
{{user_name}} as dynamic placeholders in custom header values for
OpenAI-compatible connections.

Before merging custom headers into the outgoing request,
get_headers_and_cookies() performs a simple string-replace pass
using values already available in the metadata dict and user object.
Header values with no {{...}} tokens pass through unchanged, and
unknown tokens are left as-is, so the change is fully backwards
compatible.

Use-case: providers like Manifest that use a session-scoped header
(e.g. x-session-key) to route or isolate conversations can now be
configured with {"x-session-key": "{{chat_id}}"} so every request
automatically carries the current chat UUID.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 22:00:14 -03:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui feat: interpolate template variables in custom connection headers 2026-04-26 22:00:14 -03:00
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt refac 2026-04-24 18:20:10 +09:00
requirements.txt refactor(firecrawl): use v2 API directly (#23934) 2026-04-24 18:32:08 +09:00
start.sh refac 2026-03-24 19:43:30 -05:00
start_windows.bat refac 2026-04-24 15:40:02 +09:00