[FEATURE] Support Customizable ANTHROPIC_BASE_URL in VSCode Extension

Resolved 💬 5 comments Opened Mar 24, 2026 by kefeimo Closed Apr 23, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

My workplace has an approved AI provider gateway (similar to portkey.ai) that works great with Claude Code CLI, but the VSCode extension doesn't support it. The CLI respects ANTHROPIC_BASE_URL and related environment variables, but the VSCode extension doesn't seem to pick them up.

This is blocking me from using the VSCode extension in our environment where all API traffic needs to go through approved infrastructure for security and compliance reasons.

What Works Today

Claude Code CLI works perfectly with custom endpoints:

export ANTHROPIC_BASE_URL="https://my-gateway.company.com"
export ANTHROPIC_AUTH_TOKEN="sk-xxx..."
export ANTHROPIC_MODEL="claude-sonnet-4-20250514-v1-project"
claude -p "hello"  # Works perfectly

What Doesn't Work

The VSCode extension with the same environment variables:

  • Doesn't respect ANTHROPIC_BASE_URL
  • Can't connect to custom API gateways (even when they're Anthropic-compatible)
  • Forces connection to Anthropic's official endpoints only

This creates an inconsistent experience where the CLI works but the VSCode extension doesn't, even though both are part of the same Claude Code toolchain.

Proposed Solution

My workplace has an approved AI provider gateway (similar to portkey.ai) that works great with Claude Code CLI, but the VSCode extension doesn't support it. The CLI respects ANTHROPIC_BASE_URL and related environment variables, but the VSCode extension doesn't seem to pick them up.

This is blocking me from using the VSCode extension in our environment where all API traffic needs to go through approved infrastructure for security and compliance reasons.

What Works Today

Claude Code CLI works perfectly with custom endpoints:

export ANTHROPIC_BASE_URL="https://my-gateway.company.com"
export ANTHROPIC_AUTH_TOKEN="sk-xxx..."
export ANTHROPIC_MODEL="claude-sonnet-4-20250514-v1-project"
claude -p "hello"  # Works perfectly

What Doesn't Work

The VSCode extension with the same environment variables:

  • Doesn't respect ANTHROPIC_BASE_URL
  • Can't connect to custom API gateways (even when they're Anthropic-compatible)
  • Forces connection to Anthropic's official endpoints only

This creates an inconsistent experience where the CLI works but the VSCode extension doesn't, even though both are part of the same Claude Code toolchain.

Alternative Solutions

I've considered a few workarounds, but none are ideal:

  1. Use CLI only - This works, but defeats the purpose of having the VSCode extension. I lose the integrated experience, inline suggestions, and GUI features.
  1. Proxy at network level - Could set up a transparent proxy that redirects api.anthropic.com to our gateway, but this is:
  • Complex to maintain
  • Requires infrastructure changes
  • Brittle (breaks if Anthropic changes domains or uses cert pinning)
  1. Fork and modify the extension - Technically possible but:
  • Maintenance burden keeping up with updates
  • Loses official support
  • Not scalable for team adoption
  1. Use AWS Bedrock instead - The extension supports Bedrock, but:
  • Our organization doesn't use AWS
  • Would bypass our centralized billing/compliance system
  • Not an option due to company policy

Currently I'm stuck using just the CLI, which works but isn't the full Claude Code experience.

Priority

High - Significant impact on productivity

Feature Category

Developer tools/SDK

Use Case Example

I work at an organization where we have an internal AI gateway. The CLI setup works great:

export ANTHROPIC_BASE_URL="https://our-gateway.company.com"
export ANTHROPIC_AUTH_TOKEN="sk-xxx..."
export ANTHROPIC_MODEL="claude-sonnet-4-20250514-v1-project"

Terminal usage: ✅ Works perfectly
VSCode extension: ❌ Doesn't work

This creates a frustrating situation where part of the toolchain works but not all of it.

Additional Context

Why This Matters

For enterprises and organizations that need to:

  • Route all API traffic through approved infrastructure for security/compliance
  • Use centralized billing and usage tracking
  • Access multiple AI models through a unified gateway (Claude, GPT, Gemini via one endpoint)
  • Meet specific regulatory requirements around data handling

Without this support, the VSCode extension is basically unusable in these environments, even though the CLI works fine with the same custom endpoint.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗