From c42ac87ee19cd3a7bba73f9da189e96eb1bf8e51 Mon Sep 17 00:00:00 2001 From: Futureppo Date: Mon, 16 Mar 2026 19:11:43 +0800 Subject: [PATCH] feat: Add OpenRouter chat completion provider adapter with custom headers. (#6436) --- astrbot/core/provider/sources/openrouter_source.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astrbot/core/provider/sources/openrouter_source.py b/astrbot/core/provider/sources/openrouter_source.py index 2cb446cf3..e49d0c929 100644 --- a/astrbot/core/provider/sources/openrouter_source.py +++ b/astrbot/core/provider/sources/openrouter_source.py @@ -16,4 +16,7 @@ class ProviderOpenRouter(ProviderOpenAIOfficial): self.client._custom_headers["HTTP-Referer"] = ( # type: ignore "https://github.com/AstrBotDevs/AstrBot" ) - self.client._custom_headers["X-TITLE"] = "AstrBot" # type: ignore + self.client._custom_headers["X-OpenRouter-Title"] = "AstrBot" # type: ignore + self.client._custom_headers["X-OpenRouter-Categories"] = ( + "general-chat,personal-agent" # type: ignore + )