diff --git a/packages/ai/src/providers/anthropic.ts b/packages/ai/src/providers/anthropic.ts index b2022097..4aed5a51 100644 --- a/packages/ai/src/providers/anthropic.ts +++ b/packages/ai/src/providers/anthropic.ts @@ -52,10 +52,16 @@ export class AnthropicLLM implements LLM { if (typeof process !== "undefined" && process.env) { process.env.ANTHROPIC_API_KEY = undefined; } - this.client = new Anthropic({ apiKey: null, authToken: apiKey, baseURL: model.baseUrl, defaultHeaders }); + this.client = new Anthropic({ + apiKey: null, + authToken: apiKey, + baseURL: model.baseUrl, + defaultHeaders, + dangerouslyAllowBrowser: true, + }); this.isOAuthToken = true; } else { - this.client = new Anthropic({ apiKey, baseURL: model.baseUrl }); + this.client = new Anthropic({ apiKey, baseURL: model.baseUrl, dangerouslyAllowBrowser: true }); this.isOAuthToken = false; } this.modelInfo = model;