From 20794a39bde0a0ac53e3309ba651b2994a8a4440 Mon Sep 17 00:00:00 2001 From: sergeyhatunzev <> Date: Fri, 22 May 2026 09:06:08 +0500 Subject: [PATCH] fix: use ANTHROPIC_BASE_URL env var for custom API endpoints The callAnthropic function was hardcoding the Anthropic API URL. Now reads ANTHROPIC_BASE_URL from env (falls back to default). --- v2/src/core/agent-loop.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/src/core/agent-loop.mjs b/v2/src/core/agent-loop.mjs index 36e7a3f..49e9a56 100644 --- a/v2/src/core/agent-loop.mjs +++ b/v2/src/core/agent-loop.mjs @@ -240,7 +240,8 @@ async function callAnthropic(model, state, toolDefs, settings, stream) { body.thinking = { type: 'enabled', budget_tokens: settings.thinkingBudget || 10000 }; } - const res = await fetch('https://api.anthropic.com/v1/messages', { + const baseUrl = process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com'; + const res = await fetch(`${baseUrl}/v1/messages`, { method: 'POST', headers: { 'Content-Type': 'application/json',