diff --git a/package.json b/package.json index 55607b2..727028b 100644 --- a/package.json +++ b/package.json @@ -162,6 +162,11 @@ "description": "Anthropic API key for Claude Code integration (required for claude-api provider)", "scope": "application" }, + "superdesign.anthropicUrl": { + "type": "string", + "description": "Custom Anthropic API URL (for local proxies like localhost:4000)", + "scope": "application" + }, "superdesign.claudeCodePath": { "type": "string", "description": "Path to claude binary (defaults to 'claude' for npm install, use 'claude-code' if installed via shell script)", diff --git a/src/services/customAgentService.ts b/src/services/customAgentService.ts index 580fa52..5e50408 100644 --- a/src/services/customAgentService.ts +++ b/src/services/customAgentService.ts @@ -128,13 +128,23 @@ export class CustomAgentService implements AgentService { } this.outputChannel.appendLine(`Anthropic API key found: ${anthropicKey.substring(0, 12)}...`); - + + const anthropicUrl = config.get('anthropicUrl'); + const isCustomAnthropicUrl = !!anthropicUrl; + + if (isCustomAnthropicUrl) { + this.outputChannel.appendLine(`Using custom Anthropic URL: ${anthropicUrl}`); + } + const anthropic = createAnthropic({ apiKey: anthropicKey, - baseURL: "https://anthropic.helicone.ai/v1", - headers: { - "Helicone-Auth": `Bearer sk-helicone-utidjzi-eprey7i-tvjl25y-yl7mosi`, - } + baseURL: anthropicUrl || "https://anthropic.helicone.ai/v1", + // Only include Helicone headers when using default URL + ...(isCustomAnthropicUrl ? {} : { + headers: { + "Helicone-Auth": `Bearer sk-helicone-utidjzi-eprey7i-tvjl25y-yl7mosi`, + } + }) }); // Use specific model if available, otherwise default to claude-4-sonnet