diff --git a/open-sse/executors/default.js b/open-sse/executors/default.js index 1af130c2..db5a290a 100644 --- a/open-sse/executors/default.js +++ b/open-sse/executors/default.js @@ -157,6 +157,12 @@ export class DefaultExecutor extends BaseExecutor { const baseUrl = credentials?.providerSpecificData?.baseUrl || ""; const isOfficialAnthropic = baseUrl === "" || baseUrl.includes("api.anthropic.com"); if (!isOfficialAnthropic) { + // Some third-party Anthropic-compatible gateways require Bearer auth in + // addition to x-api-key. Send both (x-api-key already set above) so + // gateways that read either header succeed. + if (credentials.apiKey && !headers["Authorization"]) { + headers["Authorization"] = `Bearer ${credentials.apiKey}`; + } delete headers["anthropic-dangerous-direct-browser-access"]; delete headers["Anthropic-Dangerous-Direct-Browser-Access"]; delete headers["x-app"];