Here is the short route. Install the Claude Code extension (published by Anthropic) from the Marketplace, open your VS Code user settings as JSON, and add two entries under claudeCode.environmentVariables: the address https://api.codexkey.online, with no /v1, and your sk_cdx_... key. After you reload the window, the Claude Code panel opens with no sign-in screen. The extension shares ~/.claude/settings.json and conversation history with the CLI, but it runs its login check before it starts the Claude process, so the key is safer in VS Code's own settings than in the Claude Code file alone.
The conclusions rest on Anthropic's official documentation (as of 10 November 2026) and on the Claude Code guide in codexkey's docs. The combination was not walked through on a clean Windows or macOS machine. Where the extension's behavior with a gateway was not tested, the text says so.
Extension or CLI: what differs
The extension puts a Claude Code panel inside the editor. It carries a private copy of the CLI but does not add claude to your PATH, so you can launch the agent from a terminal only after installing the CLI separately. The two share a lot. By the docs they use one ~/.claude/settings.json (variables, hooks, MCP servers) and the same conversations, and a session started in the extension can continue in a terminal with claude --resume.
| CLI | VS Code extension | |
|---|---|---|
| Commands and skills | All | A subset, type / to see it |
| MCP server setup | Yes | Yes, the /mcp command in the panel |
| Checkpoints | Yes | Yes |
Shell shortcut with ! | Yes | No |
| Tab completion | Yes | No |
One feature exists only in the extension: a reference to a file together with a line range, such as @app.ts#5-10. You insert it with Option+K (Alt+K on Windows and Linux). Which to choose is a matter of habit: people who like to review edits in the editor will prefer the panel, while ! and Tab matter to those who live in a terminal. A comparison with a separate AI editor is in Claude Code or Cursor in 2026.
Step 1. Install the extension
The Extensions panel opens with Ctrl+Shift+X on Windows and Linux and Cmd+Shift+X on Mac. Type Claude Code in the search box, check the publisher (it must be Anthropic) and click Install. The extension ID is anthropic.claude-code. VS Code must be 1.94.0 or newer, and the version is listed under Help, About. The extension's version number matches the Claude Code version it bundles.
You can open the panel from the spark icon on the right of the editor toolbar (it appears while a file is open), from the icon in the activity bar, or from the Claude Code button in the status bar. Nothing visible after the install? Restart VS Code or run Developer: Reload Window.
Step 2. Get a key
Two cases are common, and the extension side is the same for both.
A personal key. codexkey issues it, so you need no Anthropic account and no Claude subscription. Sign up, top up the balance and create a key in the API Keys section of the dashboard. You can top up by card, through SBP (the Russian Faster Payments System) or with crypto (USDT, BTC, ETH). The minimum top-up is $1, whichever method you pick. The key looks like sk_cdx_....
A company key. If your employer runs the gateway, or a team lead owns the codexkey account, you get the address and credentials from them and skip registration. The section on corporate proxies below covers what to ask for.
Step 3. Set the address and key
Open the command palette (Ctrl+Shift+P, or Cmd+Shift+P on Mac) and run Preferences: Open User Settings (JSON). Paste this block:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://api.codexkey.online" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk_cdx_YOUR_KEY" },
{ "name": "ANTHROPIC_MODEL", "value": "claude-sonnet-5[1m]" },
{ "name": "ANTHROPIC_DEFAULT_OPUS_MODEL", "value": "claude-opus-5-5[1m]" },
{ "name": "ANTHROPIC_DEFAULT_SONNET_MODEL", "value": "claude-sonnet-5[1m]" },
{ "name": "ANTHROPIC_DEFAULT_HAIKU_MODEL", "value": "claude-sonnet-5" },
{ "name": "CLAUDE_CODE_SUBAGENT_MODEL", "value": "claude-sonnet-5" }
]
}
The address has no /v1, because this is Claude Code and not an OpenAI-compatible client. Anthropic's gateway docs name the first two lines, and the rest come from the Claude Code guide in codexkey's documentation. Do not drop the ANTHROPIC_DEFAULT_* lines: without them Claude Code asks for its own default models and fails with "There's an issue with the selected model".
Why VS Code settings if the guide suggests ~/.claude/settings.json? Anthropic's gateway documentation explains the difference. The extension checks credentials from claudeCode.environmentVariables before launch, while values in ~/.claude/settings.json reach the process that is already running and miss the extension's own login check. Is the key in settings.json and the sign-in screen still there? Move the variables into VS Code settings. For the CLI the env block in settings.json stays convenient, and it takes the same set.
Two precautions apply to the key itself. A project's .claude/settings.json is the wrong place for it, because that file ends up in the repository. And if VS Code Settings Sync is on, user settings can travel to the cloud with the key inside, although you can exclude a setting through settingsSync.ignoredSettings.
Step 4. Check the connection
Reload the window (Developer: Reload Window), open the Claude Code panel and ask: "what files are in the project root". Expect a reply with no Sign in screen. If none arrives, test the key apart from the extension:
curl https://api.codexkey.online/v1/messages \
-H "x-api-key: sk_cdx_your_key_here" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-5","max_tokens":100,"messages":[{"role":"user","content":"hello"}]}'
The address has /v1 in this request because it calls the Messages API directly and has nothing to do with Claude Code's settings. The Anthropic base URL and Auth token lines of /status in the terminal version show which address and credential are actually in use. Whether /status exists in the extension panel was not checked: type / to see the commands you have.
Model and context
A model name with the [1m] suffix opens the full 1M context. Without it, as the guide puts it, Claude Code assumes 200K and starts compacting history at about 190K. The suffix belongs to Claude Code only and only to models with a 1M context; in other programs, such as Cline and similar extensions, write the name without it. Switch models with /model claude-opus-5-5[1m]. Take exact names from the catalog, the Model ID column.
Anthropic states outright that it does not support pointing Claude Code at non-Claude models through a gateway. So in the extension it makes sense to stay on Claude models.
What switches off when you run on a key
Running on a gateway key instead of a Claude account removes some features. Anthropic's docs name what a third-party provider loses: the plan usage bars, voice dictation and the Web tab for cloud sessions. A token brings two more limits. Voice dictation stays silent while the token is set, and Remote Control is off while the token is set or while ANTHROPIC_BASE_URL points at a host other than Anthropic's. Do you need either? Then leave gateway mode: remove the variables and sign in with claude.ai. Reading files, edits, commands, MCP and checkpoints do not depend on the mode.
Extension settings worth knowing
The extension has settings of its own under Extensions, Claude Code. Through claudeCode.useTerminal the panel switches to terminal mode and starts to resemble the CLI inside the editor. initialPermissionMode picks the permission mode at start: default, plan, acceptEdits or bypassPermissions, and the last one turns permission prompts off. It reaches the mode selector through allowDangerouslySkipPermissions, which by the docs you should enable only in sandboxes without internet access. Until it is clear which commands the agent runs in your project, keep default.
A company key behind a corporate proxy
Many searches for the extension with a custom endpoint grow out of this case: the code lives in a company network, model traffic goes through a gateway, and a proxy sits in between. The extension side takes the same two variables, and the rest depends on what your administrators set up.
Check whether it is already configured
Administrators can distribute the gateway address and credential through managed settings, and then Claude Code picks them up at startup. To find out, run claude in a terminal. A login screen opened: no credential was distributed. A session started: run /status and look for two lines, Anthropic base URL and an Auth token or API key line. If the Login method line names a claude.ai account, the credential did not reach you.
Which credential variable
Anthropic's docs split this by what the gateway team calls the credential:
| Set the credential in | Use when |
|---|---|
ANTHROPIC_AUTH_TOKEN | The gateway wants a bearer token, the Authorization header |
ANTHROPIC_API_KEY | The gateway wants an API key, the x-api-key header |
apiKeyHelper | The credential rotates or comes from a vault |
If nobody told you, start with ANTHROPIC_AUTH_TOKEN, and let a 401 be the sign to switch. A credential in the wrong variable reaches the gateway in a header it does not read. A codexkey key goes into ANTHROPIC_AUTH_TOKEN, as in step 3.
Proxy and TLS inspection
Claude Code reads the standard HTTPS_PROXY, HTTP_PROXY and NO_PROXY. It does not accept SOCKS: a local SOCKS proxy on localhost:1080 will not work directly, and you need HTTP or HTTPS. If the proxy uses advanced authentication such as NTLM or Kerberos, the docs suggest a gateway that supports it. When the proxy inspects TLS, the root certificate has to be trusted: the docs say the native installer reads the operating system store, and NODE_EXTRA_CA_CERTS covers the rest. The extension bundles its own copy of the CLI, and which runtime it uses was not checked, so if certificate errors appear, set the variable explicitly. The same variables can go into claudeCode.environmentVariables, since that setting builds the environment of the Claude process. In the extension's docs the certificate path sits in the env block of ~/.claude/settings.json, and on Windows the backslashes in the path are doubled. A block assembled from the documentation, which was not run:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://llm-gateway.example.com" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-gateway-key" },
{ "name": "HTTPS_PROXY", "value": "http://proxy.example.com:8080" },
{ "name": "NODE_EXTRA_CA_CERTS", "value": "/etc/ssl/certs/corp-ca.pem" }
]
}
For a codexkey key nothing changes: the address and token stay the same.
Allowlist and background traffic
The gateway host must be reachable through the proxy; for codexkey that is api.codexkey.online. Besides the gateway path, Claude Code sends background traffic: version checks, telemetry, release notes. On a network that allows only the gateway these requests fail and show up as blocked connections. Set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 next to the gateway variables and the traffic stops, at the cost of auto-updates. The WebFetch tool's domain safety check still calls api.anthropic.com unless you set skipWebFetchPreflight: true in settings.
A 403 from the firewall
If the gateway logs show no request but the client gets a 403 with an HTML body, a web application firewall in front of the gateway may be blocking it. The docs explain that Claude Code prompts contain XML-style tags and source code that match cross-site-scripting body rules, so a short curl test passes while real sessions fail. The fix sits on the firewall side: exempt the gateway's /v1/messages path from body inspection.
Two notes for administrators. Managed settings can pin the endpoint with allowedProviders set to ["customEndpoint"], which needs Claude Code v2.1.285 or later. And a gateway is a third party that sees your prompts and code, so the decision to send work code through it belongs to your security team. This article makes no data-handling promises.
Common errors
| What you see | Cause | What to do |
|---|---|---|
| Sign in screen or "Not logged in · Please run /login" | The extension did not find a key at startup | Set the variables in claudeCode.environmentVariables and run Developer: Reload Window. If that fails, enable claudeCode.disableLoginPrompt: Anthropic's docs describe it for third-party providers, and it was not tested with a gateway |
| Variables set in your terminal, extension ignores them | VS Code was launched from the dock or Start menu and did not inherit your shell environment | Launch with code . from that terminal, or move the variables into VS Code settings |
| "There's an issue with the selected model" | The ANTHROPIC_DEFAULT_* lines are missing | Add them from the block in step 3 |
401 | Key has a stray space, is cut off, or does not start with sk_cdx_ | Copy it from the dashboard again and check that it is active |
SSL certificate verification failed | A proxy replaces certificates | Set NODE_EXTRA_CA_CERTS, see the proxy section |
"Could not locate the Claude CLI on PATH", or claude not found in the VS Code terminal | The extension does not put claude on your PATH | Install the CLI separately: Claude Code setup guide |
| No spark icon | No file open, VS Code older than 1.94.0, Restricted Mode, or a conflict with another AI extension | Open a file, update VS Code, trust the folder, reload the window |
The environment is read only at startup, which the article Claude Code in Russia confirms as well. Changed variables outside VS Code? Quit the editor fully (Cmd+Q on macOS, closing the window is not enough) and open it again. For the CLI on Windows there is a separate piece: native PowerShell versus WSL2 is covered in the Windows install guide.
Cursor and other VS Code forks
The extension installs in Cursor too: Anthropic gives a cursor:extension/anthropic.claude-code link, and other forks take it from the Open VSX registry. Do not confuse it with Cursor's own models, which have a separate Models section and an address with /v1, covered in Cursor with Claude through codexkey.
FAQ
How do I use the extension with my own base URL?
Install the extension (published by Anthropic), open user settings as JSON and set claudeCode.environmentVariables: put the address https://api.codexkey.online in ANTHROPIC_BASE_URL, your sk_cdx_... key in ANTHROPIC_AUTH_TOKEN (or ANTHROPIC_API_KEY), and add the ANTHROPIC_DEFAULT_* lines. Anthropic's docs recommend exactly this setting for the gateway credential, because the extension checks it before launch. After reloading the window, open the Claude Code panel.
Does the Claude Code extension need a Claude subscription?
By Anthropic's docs, normal sign-in needs a paid Claude plan or a Console account. The gateway section adds that while a gateway credential variable is active, requests carry it instead of a claude.ai subscription login. This was not tested in the extension on a clean machine.
Why does the extension ignore my environment variables?
Most often VS Code was started from the dock or Start menu and never saw your shell exports. Launch it with code . from the terminal where the variables are set, or put them in VS Code settings. Settings are read at startup, so a full restart is needed.
What is the difference between the extension and the CLI?
Settings, MCP servers and history are shared. The extension has no ! shortcut and no Tab completion, and part of the commands and skills are missing, but in return you get a panel in the editor and file references with line ranges. It keeps its own copy of the CLI and does not add claude to PATH.
Does it work behind a corporate proxy?
Yes, if the proxy is HTTP or HTTPS: set HTTPS_PROXY, HTTP_PROXY and NO_PROXY. Claude Code does not support SOCKS. For a proxy that replaces certificates, add NODE_EXTRA_CA_CERTS.
Does it work in Cursor?
Yes. It installs in Cursor and in other VS Code forks, which take it through Open VSX, and the address and key settings are the same.