feat: support custom HTTP headers for OpenAI-compatible provider (#269)

Add LLM_EXTRA_HEADERS env var (format: Key:Value,Key2:Value2) to inject
custom HTTP headers into every request to OpenAI-compatible endpoints.
This enables OpenRouter attribution headers (HTTP-Referer, X-Title)
and other service-specific headers without code changes.

Closes #179

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Illia Polosukhin <[email protected]>
This commit is contained in:
alexthebuildr
2026-02-21 03:06:15 +00:00
committed by GitHub
co-authored by Claude Opus 4.6 Illia Polosukhin
parent 250551799b
commit 493e4578d0
4 changed files with 132 additions and 0 deletions
+1
View File
@@ -38,6 +38,7 @@ NEARAI_AUTH_URL=https://private.near.ai
# LLM_BACKEND=openai_compatible
# LLM_BASE_URL=https://openrouter.ai/api/v1
# LLM_API_KEY=sk-or-...
# LLM_EXTRA_HEADERS=HTTP-Referer:https://myapp.com,X-Title:MyApp
# Channel Configuration