Claude Code VS Code Extension with a Third-Party API: environmentVariables Setup
Wokey Team · 2026-09-24
Short answer: to point the Claude Code VS Code extension at a third-party API, put ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in claudeCode.environmentVariables in VS Code's user settings, and turn on claudeCode.disableLoginPrompt. Exporting variables in a terminal mostly doesn't reach the extension. ~/.claude/settings.json isn't enough either: the extension's pre-launch login check can't read it, so you keep getting the sign-in screen.
Setup
- Install the extension. It needs VS Code 1.94.0 or later. Search "Claude Code" (publisher: Anthropic) in the Extensions view (
Cmd/Ctrl+Shift+X). Cursor can install the same extension, and editors such as VSCodium can get it from Open VSX. - Open your user settings. Press
Cmd/Ctrl+Shift+Pand run Preferences: Open User Settings (JSON). - Add the settings. Inside the outermost
{}, add:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://api.wokey.ai" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "your Wokey API key" }
],
"claudeCode.disableLoginPrompt": true
}
- Reload. Run Developer: Reload Window from the command palette, then open the Claude Code panel.
Three things to watch:
ANTHROPIC_BASE_URLis the domain only, without/v1; the extension appends/v1/messagesitself.- These go in your user settings, not the workspace
.vscode/settings.json, which is often committed to the repository. disableLoginPromptskips the sign-in prompt. The official description says it's "for third-party provider setups".
Why exports and settings.json fall short
Before the extension starts the Claude process, it checks that a credential is available. That check reads only claudeCode.environmentVariables:
- VS Code opened from the Dock, Start menu or a desktop icon doesn't get variables you export in
~/.zshrc. - The
envblock in~/.claude/settings.jsonreaches the Claude process the extension starts, but not the extension's own login check.
So with only settings.json and disableLoginPrompt off, the typical symptom is an extension that keeps asking you to sign in. To use shell variables for a one-off, run code . from a terminal where they're set. For everyday use, the user settings above are more reliable.
Confirm requests go through Wokey
Run /status in the extension's prompt box (this needs Claude Code v2.1.280 or later). The Status tab's Anthropic base URL should read https://api.wokey.ai.
Choosing models
Pick Switch model… from the command menu, or click the model name below the prompt box. To pin which model each of the Opus, Sonnet and Haiku tiers uses, add the variables to the same list:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://api.wokey.ai" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "your Wokey API key" },
{ "name": "ANTHROPIC_DEFAULT_OPUS_MODEL", "value": "claude-opus-5" },
{ "name": "ANTHROPIC_DEFAULT_SONNET_MODEL", "value": "claude-sonnet-5" }
]
}
What isn't available with a third-party API
With a third-party API, the extension doesn't offer features that need a claude.ai account:
- Plan usage bars, voice dictation and the Web tab for cloud sessions.
- There's no Sign out item in the menu.
- Submitting
/bugshows an error and sends nothing.
A claude.ai account you signed in to earlier with /login stays saved but unused.
Compared with the CLI in a terminal, the extension also supports only a subset of commands, and has no ! Bash shortcut or tab completion.
Troubleshooting
The sign-in screen keeps appearing. claudeCode.environmentVariables is missing or in the wrong place (such as workspace settings), or you haven't reloaded the window since the change. Also check that disableLoginPrompt is true.
invalid x-api-key. The request went to Anthropic's own address because ANTHROPIC_BASE_URL wasn't applied. Wokey never returns that message; see the invalid x-api-key guide.
A 404 mentioning /v1/v1/messages. The base URL has an extra /v1. Change it to https://api.wokey.ai.
No reply and no error. The official advice is to run claude in a terminal for more detailed errors. The extension bundles its own CLI but doesn't add claude to your PATH, so install the CLI separately and set its variables as in the Claude Code base URL guide.
JetBrains users
The JetBrains plugin doesn't bundle a CLI. It runs your installed claude command in the IDE terminal; you can change the path under Settings → Tools → Claude Code [Beta] → Claude command. So you configure JetBrains the same way as the CLI: put ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in the env block of ~/.claude/settings.json. See the Claude Code base URL guide.
FAQ
How do I set the base URL for Claude Code in VS Code?
In VS Code's user settings (JSON), add claudeCode.environmentVariables with ANTHROPIC_BASE_URL (https://api.wokey.ai, without /v1) and ANTHROPIC_AUTH_TOKEN, set claudeCode.disableLoginPrompt to true, then run Reload Window.
Why does the extension keep asking me to sign in?
The extension's pre-launch sign-in check reads only claudeCode.environmentVariables, not shell variables or ~/.claude/settings.json. Put the variables in your user settings, turn on disableLoginPrompt, and reload the window.
Can I put this in the workspace .vscode/settings.json?
Better not. Workspace settings are often committed to the repository, which would leak your key. User settings apply to every project anyway.
How do I configure the JetBrains plugin?
The JetBrains plugin runs your installed claude command, so configure it like the CLI: put ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in the env block of ~/.claude/settings.json.