Configure the Claude Code Plugin in VS Code

Posted September 29, 2025 by XSI Tech Teamย โ€ย 2ย min read

You can use Claude Code in the terminal or install its Visual Studio Code plugin to work directly in the editor.

Step A: Install Claude Code Plugin

Install the official Claude Code Plugin.

Step B: Configure Plugin to Use XSI

Configure the VS Code plugin to use XSI's service address and your XSI API Key.

vs 0
vs 1

1. Configure Service Address (API Base URL)

  • Open VS Code settings (shortcut Ctrl+, or Cmd+,).
  • Type claude-code.environmentVariables in the search box.
  • Under the matching setting, click "Edit in settings.json".
  • Add the following JSON block to your settings.json file. If this setting already exists, make sure the content is merged correctly.
"claude-code.environmentVariables": [
    {
        "name": "ANTHROPIC_BASE_URL",
        "value": "https://api.xsirouter.com"
    }
]

2. Configure Authentication Key (API Key)

  • Create a .claude folder in your home directory and configure the key in its config.json file.

The following commands overwrite an existing config.json. If the file already exists, back it up and merge the configuration manually.

For macOS/Linux, open terminal and execute:

mkdir -p ~/.claude
echo '{"primaryApiKey": "Your XSI API Key"}' > ~/.claude/config.json

For Windows, open PowerShell and execute:

New-Item -ItemType Directory -Force -Path "$HOME\.claude"
Set-Content -Path "$HOME\.claude\config.json" -Value '{"primaryApiKey": "Your XSI API Key"}'
  • Make sure to replace Your XSI API Key with your actual key from m.xsirouter.com.

Step C: Restart and Start Using

  1. Completely exit and restart VS Code to ensure all configurations take effect.
  2. Click the Claude icon in the VS Code activity bar to open the chat window and start a conversation.
  3. You can now interact with Claude in VS Code. Requests sent through XSI are billed and recorded there.