Skip to content

Claude Code in VS Code

You can use Claude Code directly in VS Code with Anthropic's official extension. When configured with NordRouter, the extension sends requests through your NordRouter API key and charges your account balance.

Requirements

1. Install the extension

  1. Open VS Code.
  2. Press Ctrl+Shift+X on Windows/Linux or Cmd+Shift+X on macOS.
  3. Search for Claude Code and install Anthropic's official extension.
  4. If the Claude panel does not appear, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), run Developer: Reload Window, and wait for the window to reload.

Then open VS Code settings (Ctrl+, / Cmd+,), search for Claude Code: Disable Login Prompt, and enable it. This prevents the Anthropic sign-in prompt when you use a third-party API provider.

The extension includes its own Claude Code CLI for the graphical panel. You do not need a separate CLI installation for normal use inside the extension.

2. Add the NordRouter settings

Open or create this file:

  • Windows: %USERPROFILE%\.claude\settings.json;
  • macOS and Linux: ~/.claude/settings.json.

Paste the configuration below and replace sk-nr-YOUR-KEY with your API key:

json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "ANTHROPIC_API_KEY": "sk-nr-YOUR-KEY",
    "ANTHROPIC_BASE_URL": "https://nordrouter.com",
    "ANTHROPIC_MODEL": "anthropic/claude-sonnet-4.6",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "anthropic/claude-opus-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "anthropic/claude-sonnet-4.6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "anthropic/claude-haiku-4.5",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Do not add /v1 to the Base URL

Use exactly https://nordrouter.com. Claude Code adds the Anthropic API path automatically. Adding /v1 can produce an invalid /v1/v1/messages request.

The extension and the standalone Claude Code CLI share the same ~/.claude/settings.json file, so you only need to configure it once.

3. Open Claude Code

  1. Open your project folder in VS Code.
  2. Click the Claude icon in the Activity Bar or the Spark icon in the top-right corner of the editor.
  3. If the icon is not visible, open the Command Palette and run Claude Code: Open in New Tab.
  4. After changing settings.json, run Developer: Reload Window once.

For the first test, select Plan mode and send a read-only request:

Explain the structure of this project without changing any files.

If Claude responds and the request appears in your activity history, the connection is working.

Change the model

Change ANTHROPIC_MODEL in settings.json, for example:

json
"ANTHROPIC_MODEL": "anthropic/claude-opus-5"

Always use the full model ID with the anthropic/ prefix. See the NordRouter model catalog for available models and current prices.

Troubleshooting

The extension asks you to sign in to Anthropic

Make sure Claude Code: Disable Login Prompt is enabled and ANTHROPIC_API_KEY is inside the env object in .claude/settings.json. Then run Developer: Reload Window. If you previously signed in with an Anthropic account, run /logout in the Claude Code terminal and reload VS Code.

Auth conflict: Both a token and an API key are set

An old ANTHROPIC_AUTH_TOKEN is conflicting with your API key. Remove that variable from your environment and settings.json, leaving only ANTHROPIC_API_KEY.

Invalid URL or a request to /v1/v1/messages

Remove /v1 from ANTHROPIC_BASE_URL. It must be exactly https://nordrouter.com.

No pricing available for model …

Use the full model ID, such as anthropic/claude-sonnet-4.6, and verify the ANTHROPIC_DEFAULT_*_MODEL values against the configuration above.

Claude Code is not visible in VS Code

Update VS Code to version 1.94 or later, make sure the extension is enabled in the current profile, and run Developer: Reload Window.

If the issue remains, see the complete Claude Code setup guide and troubleshooting guide.

Official documentation