Claude Code in VS Code

Install the Claude Code extension in VS Code, point it at AI in IDE with one API key, and verify the first request without an Anthropic subscription.

The whole setup is one extension, one key, and one JSON block — no credit card with Anthropic and no per-seat plan.

This guide covers VS Code itself. Cursor uses the same extension and the same settings, so Claude Code in Cursor is the shorter path if that is your editor. JetBrains is a different story: the plugin does not bundle the CLI, so follow Claude Code in JetBrains.

Versions and prerequisites

ComponentMinimumHow to check
VS Code1.94.0Help → About
Claude Code extensionany current buildExtensions view
Node.js22 or later for npm installation. The native CLI runs without Node.js.node -v
AI in IDE keyAWSQ or CCMAX channeldashboard

The extension version number is the Claude Code version it ships with: extension 2.1.286 contains Claude Code 2.1.286. Installing the extension does not add claude to your PATH — that needs the standalone CLI (npm install -g @anthropic-ai/claude-code). You only need the CLI for terminal sessions or claude mcp add; the chat panel works without it.

Install the extension

  • Direct link: Install for VS Code — it opens the Extensions view with the publisher already resolved and still asks you to confirm the install.
  • Manual: Cmd+Shift+X (macOS) or Ctrl+Shift+X (Windows/Linux), search for Claude Code, click Install.
  • Offline or blocked marketplace: download the VSIX from the Visual Studio Marketplace and use Install from VSIX….

If the panel does not appear afterwards, run Developer: Reload Window from the Command Palette. Extension marketplaces are third-party software; a fresh install always asks you to confirm.

Create and copy the API key

  1. Pick a plan on the pricing page. One account can hold separate Claude, GPT, and Gemini keys; each key is tied to its vendor channel.
  2. Open API Keys in your dashboard and create a key.
  3. Choose the AWSQ or CCMAX channel — those are the Claude Code channels. A Codex or Gemini key will be rejected here.
  4. You can view or copy the full key again from the API Keys list.

Replace YOUR_DASHBOARD_API_KEY in every snippet below with that value.

Configuration

There are two layers, and this is where most setups break. VS Code launched from the Dock or Start menu does not inherit your shell profile, so export ANTHROPIC_BASE_URL=... in ~/.zshrc works in the integrated terminal but not in the chat panel. Write the values into the Claude Code settings file instead; both the extension and the CLI read it.

1. Claude Code settings file

~/.claude/settings.json on macOS and Linux, C:/Users/<UserName>/.claude/settings.json on Windows. Create the file and the directory if they do not exist:

1
{
2
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
  "env": {
4
    "ANTHROPIC_BASE_URL": "https://api.aiinide.com",
5
    "ANTHROPIC_AUTH_TOKEN": "YOUR_DASHBOARD_API_KEY",
6
    "API_TIMEOUT_MS": "600000",
7
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
8
  }
9
}

Keep ANTHROPIC_BASE_URL at the bare host. Claude Code appends /v1/messages itself; https://api.aiinide.com/v1 produces a request to /v1/v1/messages and a 404. If you already have a settings.json, merge the env object rather than replacing the file, or you will lose your permission rules and hooks.

2. Skip the Anthropic sign-in prompt

The panel is built around a claude.ai account and shows a sign-in screen on first open. Tell it not to:

1
"claudeCode.disableLoginPrompt": true

Put that in your VS Code user settings.json (Cmd+, / Ctrl+, → search for "Claude Code login"), or in the Extensions section under Claude Code.

3. Optional: pin the model and timeouts

1
{
2
  "model": "claude-sonnet-5-5",
3
  "env": {
4
    "ANTHROPIC_BASE_URL": "https://api.aiinide.com",
5
    "ANTHROPIC_AUTH_TOKEN": "YOUR_DASHBOARD_API_KEY"
6
  }
7
}

Leave model out and the extension falls back to its default picker; you can switch mid-session with /model.

4. If you prefer environment variables

Shell profiles still work for terminal sessions and are useful when you launch the editor from a terminal with code .. On macOS or Linux:

1
export ANTHROPIC_BASE_URL='https://api.aiinide.com'
2
export ANTHROPIC_AUTH_TOKEN="YOUR_DASHBOARD_API_KEY"
3
export API_TIMEOUT_MS=600000
4
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

On Windows: setx ANTHROPIC_BASE_URL "https://api.aiinide.com" and repeat for the other three, then restart VS Code. Environment-variable precedence means an exported ANTHROPIC_AUTH_TOKEN in your shell wins over the file, so keep only one source of truth.

Verify

First check your key and Claude channel by listing models. This request does not consume quota.

1
curl --globoff -i 'https://api.aiinide.com/v1/models' \
2
  -H "x-api-key: YOUR_DASHBOARD_API_KEY" \
3
  -H "anthropic-version: 2023-06-01"

HTTP 200 returns the model list. HTTP 401 means the key is missing, invalid, or expired. HTTP 400 means this key belongs to a different channel. Use an ID from the list in the Messages example below.

  1. Spark icon. Open a file and click the Spark icon in the editor toolbar, or ✻ Claude Code in the status bar. No sign-in screen should appear.
  2. /status. In the prompt box, run /status. It reports the extension's Claude Code version and the active model.
  3. Send a short prompt in the editor, then check the key’s usage in the dashboard.
  4. Test model inference directly with the verified key.
1
curl --globoff 'https://api.aiinide.com/v1/messages' \
2
  -H "x-api-key: YOUR_DASHBOARD_API_KEY" \
3
  -H "anthropic-version: 2023-06-01" \
4
  -H "Content-Type: application/json" \
5
  -d '{"model":"MODEL_ID_FROM_LIST","messages":[{"role":"user","content":"ping"}],"max_tokens":16}'
  1. Usage. Open Usage. A successful prompt shows up as token usage against that key.

Troubleshooting

Use an exact ID from GET /v1/models. A mistyped claude-* name can resolve to the configured default Claude model and incur charges at that model’s rate.

API Error: 404

Set ANTHROPIC_BASE_URL to https://api.aiinide.com. Adding /v1 sends the request to /v1/v1/messages, which returns 404.

API Error: 400 — invalid request

  • Wrong channel. Codex and Gemini keys authenticate against different paths and return 400 here. Re-create the key with AWSQ or CCMAX.
  • Stale settings.json. A trailing comma or a value pasted into the wrong nesting level makes the file unparsable, and the extension falls back to defaults. Validate it — the $schema line gives you inline errors in VS Code.

Authentication checks

Use the status from GET /v1/models to diagnose the key. Native POST /v1/messages can return HTTP 200 with an authentication message in content even when the key is missing or invalid.

  • Token not loaded. The panel process did not read settings.json. Save the file, then Developer: Reload Window; a full VS Code restart is the reliable version.
  • ANTHROPIC_API_KEY wins. If your shell also exports ANTHROPIC_API_KEY, an old Anthropic key may take precedence over ANTHROPIC_AUTH_TOKEN. Unset it.
  • Expired key. Keys created with an expiration stop working silently. Check the key's dates in the dashboard and rotate.

Network, TLS, and timeouts

SymptomCauseFix
fetch failed, ECONNRESET, requests hangcorporate proxy or VPNexport HTTPS_PROXY, restart VS Code
Self-signed certificate detectedTLS-inspecting proxyset NODE_EXTRA_CA_CERTS in env to the proxy root CA
Requests die at exactly one minuteAPI_TIMEOUT_MS not appliedput it in settings.json, not only in the shell
Panel silent, no errorextension could not launch its bundled CLIClaude Code: Show Logs from the Command Palette

Window-specific problems

  • Restricted Mode. The extension is disabled in untrusted workspaces. Trust the folder and reload.
  • Remote SSH, WSL, or a dev container. Settings must be on the remote host, at ~/.claude/settings.json inside that environment. Editing the local file has no effect on remote sessions.
  • claude: command not found in the integrated terminal. Expected: the extension does not install the CLI. Install it globally, or keep using the chat panel.
  • Spark icon missing. It needs an open file. Then check the version (1.94.0+) and temporarily disable other AI extensions that register the same toolbar slot.

Models and pricing

ModelChannelBest for
claude-opus-5-5 (alias claude-opus-5.5)AWSQ, CCMAXhard refactors, long agent runs
claude-sonnet-5-5 (alias claude-sonnet-5.5)AWSQ, CCMAXeveryday coding, the default choice
claude-haiku-4-5-20251001AWSQ, CCMAXfast edits, cheap verification calls

Opus 5.5 base rates are $4 per 1M input tokens, $0.20 per 1M cache reads, and $20 per 1M output tokens. AWSQ consumes quota at 0.8× and CCMAX at 2×, so the same key buys different amounts of work per channel. If the upstream serves Fast mode, base and cache rates double and billing follows usage.speed.

FAQ

Do I need an Anthropic subscription as well? No. That is the point of the setup: ANTHROPIC_AUTH_TOKEN plus a base URL replaces the claude.ai login, and claudeCode.disableLoginPrompt stops the extension asking for one.

Can I use the same key in Cursor? Yes. Cursor runs the same extension, so the same settings.json and the same claudeCode.* settings apply. See Claude Code in Cursor.

Does the extension read my workspace settings.json? Some settings, such as the initial permission mode, are user-scope only. Put connection settings in ~/.claude/settings.json so every workspace and window sees them.

Claude Code in VS Code - AI in IDE Documentation | AI in IDE