Router One
Router One

One-click setup (recommended)

One command installs the CLI, writes the gateway config, and verifies your key with a 1-token test request. Existing config files are backed up automatically.

The key is only inserted into the command locally in your browser; it is never uploaded.

bash
curl -fsSL https://router.one/install/claude-code.sh | bash -s -- sk-your-api-key

Config takes effect immediately — run claude to start.

Review the script before running: /install/claude-code.sh · /install/claude-code.ps1

Manual setup

Prefer to see every step, or need to customize? Configure each tool manually below.

Claude Code CLI Setup Guide

Configure Claude Code CLI to use Router One as a proxy for unified routing, cost controls, and full observability.

Before you start, create your API Key on the Dashboard API Keys page (format: sk-xxx).
1

Install Node.js via Homebrew

Claude Code CLI requires Node.js 18 or later.

bash
brew install node
bash
node --version
2

Install Claude Code CLI globally

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

Configure environment variables

Point Claude Code at Router One as its API endpoint.

If you previously used the official Claude CLI, clear the old config first to avoid conflicts: rm -rf ~/.claude

Temporary (current terminal session only):

bash
export ANTHROPIC_BASE_URL=https://api.router.one
export ANTHROPIC_AUTH_TOKEN=sk-your-api-key

Permanent (write to shell config):

bash
echo 'export ANTHROPIC_BASE_URL=https://api.router.one' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN=sk-your-api-key' >> ~/.zshrc
source ~/.zshrc
ANTHROPIC_AUTH_TOKEN is sent to the gateway as Authorization: Bearer — you do not need ANTHROPIC_API_KEY. Note: the one-click script stores the same config in the env block of ~/.claude/settings.json, which takes precedence over shell environment variables; when rotating keys, update settings.json or just re-run the one-click command.
4

Launch Claude Code

Run this to start the CLI:

bash
claude