Claude Code
Recommended: use cc-switch for setup: https://github.com/farion1231/cc-switch/releases
This service supports the Anthropic Messages format required by Claude Code.
The relevant endpoint is POST /v1/messages.
Prerequisites
According to Anthropic's official docs, the CLI install path depends on Node.js and npm.
- Minimum requirement:
Node.js 18+ npmis usually installed together with Node.js- On Windows CLI workflows, Anthropic recommends using
WSL
If you plan to use the npm install path below, install Node.js first from: https://nodejs.org/en/download
- macOS / Windows: install the
LTSrelease from that page - Linux: use the distro-specific method listed there
On macOS, if you already use Homebrew, you can also run:
brew install nodeThis installs both Node.js and npm.
If you prefer to avoid installing Node.js manually first, Anthropic also provides a native installer:
curl -fsSL https://claude.ai/install.sh | bashVerify your environment first:
node -v
npm -vIf either command is missing, install Node.js before continuing.
Install
Official getting started guide: https://docs.anthropic.com/en/docs/claude-code/getting-started
A common official install path is:
npm install -g @anthropic-ai/claude-codeDo not use sudo npm install -g, to avoid permission and environment issues.
For platform-specific install, version management, and uninstall notes, see: https://code.claude.com/docs/en/setup
Configure
If you do not use cc-switch, configure Claude Code with its official environment variables:
export ANTHROPIC_BASE_URL="https://enjoy.aigemini.org"
export ANTHROPIC_API_KEY="codex_your_api_key"
claudeIf you prefer to keep the configuration in Claude Code's shared config file, put it in ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_API_KEY": "codex_xyz",
"ANTHROPIC_BASE_URL": "https://enjoy.aigemini.org",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_MODEL": "claude-opus-4-6",
"ANTHROPIC_REASONING_MODEL": "claude-opus-4-6"
},
"model": "claude-sonnet-4-6",
"skipDangerousModePermissionPrompt": true
}This lets the CLI and VS Code extension share the same Claude Code configuration.
Use the service root in ANTHROPIC_BASE_URL, not the full /v1/messages path.
VS Code Extension
As of March 31, 2026, Anthropic's official docs present the VS Code extension as the recommended way to use Claude Code inside VS Code.
The usual path is:
- Install the official
Claude Codeextension from the VS Code marketplace. - Or run
claudein VS Code's integrated terminal and let the extension auto-install. - If you start from an external terminal, run
/ideinside Claude Code to connect it to the current VS Code window.
Anthropic also documents that the VS Code extension and CLI share the same Claude Code configuration system.
For this gateway, the safest path is still:
- set
ANTHROPIC_BASE_URL - set
ANTHROPIC_API_KEY
Then launch claude from the integrated terminal at the project root. The extension and CLI will use the same connection setup.
If you need to change extension-specific UI behavior, use VS Code settings under Extensions / Claude Code. If you need shared Claude behavior, use ~/.claude/settings.json.
Verify
After launch, run:
/statusIf Claude Code shows your custom ANTHROPIC_BASE_URL and can start a session normally, the setup is working.
If you use the VS Code extension, being able to start a session from the extension panel also confirms that the configuration is active.
