[BUG] [VS Code Extension] LLM Gateway/Custom ANTHROPIC_BASE_URL not working in v2.0.0+

Resolved 💬 4 comments Opened Oct 6, 2025 by Koobah Closed Oct 6, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The VS Code extension fails to work with custom LLM Gateway configurations that work perfectly with the Claude Code CLI.
This appears to be a regression introduced in version 2.0.0. The extension ignores custom ANTHROPIC_BASE_URL settings and attempts to use default cloud provider authentication instead of respecting custom gateway endpoints.

What Should Happen?

VS Code extension should support the same LLM Gateway configurations as the CLI, including:

  • Custom ANTHROPIC_BASE_URL endpoints for internal/proxy gateways
  • API key helper scripts for dynamic authentication
  • Third-party proxy configurations without requiring cloud provider credentials
  • Automatic inheritance of working CLI configurations

Error Messages/Logs

With Vertex configuration:
  API Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.

With Bedrock configuration:
API Error: No projectId was given and it could not be resolved from credentials. The client should be instantiated with the projectId option or the ANTHROPIC_VERTEX_PROJECT_ID environment variable should be set.

Steps to Reproduce

  1. Working CLI Setup: Configure Claude Code CLI with custom gateway:

{
"apiKeyHelper": "npx @company/auth-token@latest get_token",
"env": {
"ANTHROPIC_MODEL": "custom-model-endpoint",
"ANTHROPIC_BASE_URL": "https://internal-gateway.company.com/api/v1/anthropic",
"CLAUDE_CODE_API_KEY_HELPER_TTL_MS": "360000000"
}
}

  1. Verify CLI Works: Confirm Claude Code CLI successfully connects and works with custom gateway
  2. Configure VS Code Extension: Add environment variables to VS Code settings.json:

"claude-code.environmentVariables": [
{"name": "ANTHROPIC_BASE_URL", "value": "https://internal-gateway.company.com/api/v1/anthropic"},
{"name": "ANTHROPIC_MODEL", "value": "custom-model-endpoint"},
{"name": "CLAUDE_CODE_USE_BEDROCK", "value": "true"},
{"name": "CLAUDE_CODE_SKIP_BEDROCK_AUTH", "value": "true"}
]

  1. Attempt to Use Extension: Try to use Claude Code in VS Code
  2. Observe Failure: Extension attempts default cloud authentication instead of using custom gateway or Claude keeps "thinking" without any response.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

<2.0.0

Claude Code Version

2.0.8

Platform

Other

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

  • This worked in pre-2.0.0 versions but broke after the extension rewrite
  • Related to issues #8522 (ANTHROPIC_BASE_URL not recognized) and #8500 (environment variables don't override settings)
  • LLM Gateway documentation exists for CLI but has no VS Code extension instructions
  • Currently forced to use CLI exclusively as workaround

View original on GitHub ↗

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