From 46bda549df75233d2a4bb7a3b5ff8b721f475268 Mon Sep 17 00:00:00 2001 From: hello_world <153901583+chengcheng84@users.noreply.github.com> Date: Sat, 17 Jan 2026 12:23:09 +0800 Subject: [PATCH] fix: add headers for openrouter --- src/aiCore/legacy/clients/openai/OpenAIBaseClient.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/aiCore/legacy/clients/openai/OpenAIBaseClient.ts b/src/aiCore/legacy/clients/openai/OpenAIBaseClient.ts index 6e1313800..8aff22a77 100644 --- a/src/aiCore/legacy/clients/openai/OpenAIBaseClient.ts +++ b/src/aiCore/legacy/clients/openai/OpenAIBaseClient.ts @@ -167,7 +167,11 @@ export abstract class OpenAIBaseClient< ...this.defaultHeaders(), ...this.provider.extra_headers, ...(this.provider.id === 'copilot' ? { 'editor-version': 'vscode/1.97.2' } : {}), - ...(this.provider.id === 'copilot' ? { 'copilot-vision-request': 'true' } : {}) + ...(this.provider.id === 'copilot' ? { 'copilot-vision-request': 'true' } : {}), + ...(this.provider.id === 'openrouter' ? { + 'X-Title': 'Cherry Studio', + 'HTTP-Referer': 'https://cherry-ai.com', + } : {}) } }) as TSdkInstance }