Claude Code
Anthropic Claude Code is Anthropic's official agentic CLI. PrimeRouter exposes a byte-identical Anthropic endpoint, so Claude Code "just works".
The easier route: the one-click install page
Open primerouter.ai/en/install/claude-code, sign in, and download an installer with your API key already embedded — it does everything on this page.
How it's wired
Claude Code reads ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN at startup. The installer appends them to .zshrc / .bashrc (macOS / Linux) or sets them as user-level environment variables on Windows. It also sets CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 to skip non-essential requests (telemetry, error reporting, update checks).
One-line installer
irm https://primerouter.ai/install/claude-code.ps1 | iexcurl -fsSL https://primerouter.ai/install/claude-code.sh | bash💡 What it does: ① verify Node v22+ ② install
@anthropic-ai/claude-codeglobally if missing ③ prompt for the API key with hidden input ④ back up your shell rc file then append a single PrimeRouter block.
Open a new terminal and run:
claudeFallback: manual install
Full manual setup
See Coding Tools → Claude Code for the long-form guide. TL;DR:
- Install Node.js v22+
npm install -g @anthropic-ai/claude-code- Set three env vars:bash
export ANTHROPIC_BASE_URL="https://primerouter.ai" export ANTHROPIC_AUTH_TOKEN="sk-your-key" export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 - Open a new terminal and run
claude
