Skip to content
2api2api Docs
Open console

Claude

Claude Code extension (VS Code / Cursor)

Get the command-line Claude Code working first, then install the extension. If the extension shows a login page, add two settings in the editor.

  1. First set up Claude Code as described in Claude Code. Check that running claude in a terminal gives you a normal conversation.

  2. Search for Claude Code in the VS Code or Cursor extension marketplace and install the official extension whose publisher is Anthropic (ID anthropic.claude-code).

  3. Fully quit the editor and open it again. Press Ctrl+Shift+P (Cmd+Shift+P on macOS), search for Claude Code and open the panel.

The extension’s own login check doesn’t read ~/.claude/settings.json. An editor opened from the Dock or the Start menu also can’t see variables you export in a terminal. Add these two settings to the editor’s user settings, then fully quit the editor and open it again.

To open the user settings, press Ctrl+Shift+P (Cmd+Shift+P on macOS), type Preferences: Open User Settings (JSON) and press Enter:

VS Code / Cursor user settings.json
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://2api.dev" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-your-key" }
],
"claudeCode.disableLoginPrompt": true
}

If the file already has settings in it, don’t paste the outer { }. Paste only the lines in between, after the last existing item, and add a comma to the end of that item.