Skip to content

Claude Code

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+
  • npm is 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 LTS release from that page
  • Linux: use the distro-specific method listed there

On macOS, if you already use Homebrew, you can also run:

bash
brew install node

This installs both Node.js and npm.

If you prefer to avoid installing Node.js manually first, Anthropic also provides a native installer:

bash
curl -fsSL https://claude.ai/install.sh | bash

Verify your environment first:

bash
node -v
npm -v

If 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:

bash
npm install -g @anthropic-ai/claude-code

Do 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

Put the configuration directly in Claude Code's shared config file at ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_API_KEY": "codex_xyz",
    "ANTHROPIC_BASE_URL": "https://api.gemiaude.com",
    "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.

Option 2: Environment variables

You can also configure Claude Code using its official environment variables:

export ANTHROPIC_BASE_URL="https://api.gemiaude.com"
export ANTHROPIC_API_KEY="codex_your_api_key"
claude

Use the service root in ANTHROPIC_BASE_URL, not the full /v1/messages path.

Option 3: cc-switch tool

If you prefer a tool to write the configuration automatically, you can use cc-switch: https://github.com/farion1231/cc-switch/releases

Restart claude after the configuration is applied.

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:

  1. Install the official Claude Code extension from the VS Code marketplace.
  2. Or run claude in VS Code's integrated terminal and let the extension auto-install.
  3. If you start from an external terminal, run /ide inside 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:

text
/status

If 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.

OpenAI-compatible gateway integration docs