Skip to content
Router One
Skip to content
Router One

CLI Setup Guide

One-click setup for Claude Code and Codex CLI, plus manual configuration for OpenClaw and Hermes Agent.

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.

powershell
$env:ROUTER_ONE_API_KEY = "sk-your-api-key"; irm https://router.one/install/claude-code.ps1 | iex

Config takes effect immediately — run claude to start.

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

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

New terminals work right away; in the current one, run source ~/.zshrc (or your shell profile) first, then codex.

powershell
$env:ROUTER_ONE_API_KEY = "sk-your-api-key"; irm https://router.one/install/codex.ps1 | iex

The current session is ready — run codex to start.

Review the script before running: /install/codex.sh · /install/codex.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
1

Install Node.js

Download from the Node.js website or use winget.

powershell
winget install OpenJS.NodeJS.LTS
powershell
node --version
2

Install Claude Code CLI globally

powershell
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: Remove-Item -Recurse -Force ~\.claude

Temporary (current PowerShell session only):

powershell
$env:ANTHROPIC_BASE_URL = "https://api.router.one"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-api-key"

Permanent (system environment variables):

powershell
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.router.one", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-your-api-key", "User")
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:

powershell
claude
1

Install Node.js

Install Node.js 18+ via a package manager or nvm.

Via nvm (recommended):

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
node --version

Or via apt (Debian/Ubuntu):

bash
sudo apt update && sudo apt install -y nodejs npm
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' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN=sk-your-api-key' >> ~/.bashrc
source ~/.bashrc
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

Codex CLI Setup Guide

Configure OpenAI Codex 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

Codex CLI requires Node.js 16 or later.

bash
brew install node
bash
node --version
2

Install Codex CLI globally

bash
npm install -g @openai/codex
3

Configure environment variables

Point Codex at Router One as its API endpoint.

Temporary (current terminal session only):

bash
export ROUTER_ONE_API_KEY=sk-your-api-key

Permanent (write to shell config):

bash
echo 'export ROUTER_ONE_API_KEY=sk-your-api-key' >> ~/.zshrc
source ~/.zshrc
4

Create the Codex config file

Write the following to ~/.codex/config.toml to register Router One as a model provider.

bash
mkdir -p ~/.codex && cat > ~/.codex/config.toml <<'EOF'
model = "gpt-5.6-sol"
model_provider = "router"
model_reasoning_effort = "high"
model_verbosity = "high"
web_search = "live"

[model_providers.router]
base_url = "https://api.router.one/v1"
env_key = "ROUTER_ONE_API_KEY"
env_key_instructions = "Create an API key at https://router.one/dashboard/api-keys and set the ROUTER_ONE_API_KEY environment variable."
name = "Router One"
wire_api = "responses"
EOF
5

Launch Codex

Run this to start the CLI:

bash
codex
1

Install Node.js

Download from the Node.js website or use winget.

powershell
winget install OpenJS.NodeJS.LTS
powershell
node --version
2

Install Codex CLI globally

powershell
npm install -g @openai/codex
3

Configure environment variables

Point Codex at Router One as its API endpoint.

Temporary (current PowerShell session only):

powershell
$env:ROUTER_ONE_API_KEY = "sk-your-api-key"

Permanent (system environment variables):

powershell
[System.Environment]::SetEnvironmentVariable("ROUTER_ONE_API_KEY", "sk-your-api-key", "User")
4

Create the Codex config file

Write the following to %USERPROFILE%\.codex\config.toml to register Router One as a model provider.

powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex" | Out-Null
$config = @'
model = "gpt-5.6-sol"
model_provider = "router"
model_reasoning_effort = "high"
model_verbosity = "high"
web_search = "live"

[model_providers.router]
base_url = "https://api.router.one/v1"
env_key = "ROUTER_ONE_API_KEY"
env_key_instructions = "Create an API key at https://router.one/dashboard/api-keys and set the ROUTER_ONE_API_KEY environment variable."
name = "Router One"
wire_api = "responses"
'@
[System.IO.File]::WriteAllText("$env:USERPROFILE\.codex\config.toml", $config, (New-Object System.Text.UTF8Encoding($false)))
5

Launch Codex

Run this to start the CLI:

powershell
codex
1

Install Node.js

Install Node.js 16+ via a package manager or nvm.

Via nvm (recommended):

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
node --version

Or via apt (Debian/Ubuntu):

bash
sudo apt update && sudo apt install -y nodejs npm
2

Install Codex CLI globally

bash
npm install -g @openai/codex
3

Configure environment variables

Point Codex at Router One as its API endpoint.

Temporary (current terminal session only):

bash
export ROUTER_ONE_API_KEY=sk-your-api-key

Permanent (write to shell config):

bash
echo 'export ROUTER_ONE_API_KEY=sk-your-api-key' >> ~/.bashrc
source ~/.bashrc
4

Create the Codex config file

Write the following to ~/.codex/config.toml to register Router One as a model provider.

bash
mkdir -p ~/.codex && cat > ~/.codex/config.toml <<'EOF'
model = "gpt-5.6-sol"
model_provider = "router"
model_reasoning_effort = "high"
model_verbosity = "high"
web_search = "live"

[model_providers.router]
base_url = "https://api.router.one/v1"
env_key = "ROUTER_ONE_API_KEY"
env_key_instructions = "Create an API key at https://router.one/dashboard/api-keys and set the ROUTER_ONE_API_KEY environment variable."
name = "Router One"
wire_api = "responses"
EOF
5

Launch Codex

Run this to start the CLI:

bash
codex

OpenClaw CLI Setup Guide

Configure OpenClaw to use Router One as a custom OpenAI-compatible provider for agent model calls.

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

Install Node.js via Homebrew

OpenClaw CLI requires Node.js 22.14.0 or later.

bash
brew install node
bash
node --version
2

Install OpenClaw CLI globally

bash
npm install -g openclaw@latest
3

Configure environment variables

Point OpenClaw at Router One as its API endpoint.

Temporary (current terminal session only):

bash
export CUSTOM_API_KEY=sk-your-api-key

Permanent (write to shell config):

bash
echo 'export CUSTOM_API_KEY=sk-your-api-key' >> ~/.zshrc
source ~/.zshrc
4

Run OpenClaw onboarding

Register Router One as a custom OpenAI-compatible provider and install the local daemon.

bash
openclaw onboard --non-interactive \
  --auth-choice custom-api-key \
  --custom-base-url https://api.router.one/v1 \
  --custom-model-id gpt-5.6-sol \
  --custom-provider-id router-one \
  --custom-compatibility openai \
  --install-daemon
5

Launch OpenClaw

Run this to start the CLI:

bash
openclaw
1

Install Node.js

Download from the Node.js website or use winget.

powershell
winget install OpenJS.NodeJS.LTS
powershell
node --version
2

Install OpenClaw CLI globally

powershell
npm install -g openclaw@latest
3

Configure environment variables

Point OpenClaw at Router One as its API endpoint.

Temporary (current PowerShell session only):

powershell
$env:CUSTOM_API_KEY = "sk-your-api-key"

Permanent (system environment variables):

powershell
[System.Environment]::SetEnvironmentVariable("CUSTOM_API_KEY", "sk-your-api-key", "User")
4

Run OpenClaw onboarding

Register Router One as a custom OpenAI-compatible provider and install the local daemon.

powershell
openclaw onboard --non-interactive `
  --auth-choice custom-api-key `
  --custom-base-url https://api.router.one/v1 `
  --custom-model-id gpt-5.6-sol `
  --custom-provider-id router-one `
  --custom-compatibility openai `
  --install-daemon
5

Launch OpenClaw

Run this to start the CLI:

powershell
openclaw
1

Install Node.js

Install Node.js 22.14.0+ via a package manager or nvm.

Via nvm (recommended):

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install 24
node --version

Or via apt (Debian/Ubuntu):

bash
sudo apt update && sudo apt install -y nodejs npm
2

Install OpenClaw CLI globally

bash
npm install -g openclaw@latest
3

Configure environment variables

Point OpenClaw at Router One as its API endpoint.

Temporary (current terminal session only):

bash
export CUSTOM_API_KEY=sk-your-api-key

Permanent (write to shell config):

bash
echo 'export CUSTOM_API_KEY=sk-your-api-key' >> ~/.bashrc
source ~/.bashrc
4

Run OpenClaw onboarding

Register Router One as a custom OpenAI-compatible provider and install the local daemon.

bash
openclaw onboard --non-interactive \
  --auth-choice custom-api-key \
  --custom-base-url https://api.router.one/v1 \
  --custom-model-id gpt-5.6-sol \
  --custom-provider-id router-one \
  --custom-compatibility openai \
  --install-daemon
5

Launch OpenClaw

Run this to start the CLI:

bash
openclaw

Full OpenClaw integration guide →

Hermes Agent Setup Guide

Configure Hermes Agent to use Router One as a custom OpenAI-compatible endpoint with persistent model settings.

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

Install Python and pip

Hermes Agent installs with pip. Windows users should run Hermes inside WSL2.

bash
brew install python
python3 --version
python3 -m pip --version
bash
node --version
2

Install Hermes Agent CLI globally

bash
pip install hermes-agent
hermes postinstall
3

Create the Hermes config file

Write the following to ~/.hermes/config.yaml to persist Router One as the custom endpoint.

bash
mkdir -p ~/.hermes && cat > ~/.hermes/config.yaml <<'EOF'
model:
  provider: custom
  default: gpt-5.6-sol
  base_url: https://api.router.one/v1
  api_key: sk-your-api-key
  context_length: 65536
EOF
OPENAI_BASE_URL is not used by Hermes Agent. Use hermes model or edit ~/.hermes/config.yaml directly.
4

Launch Hermes Agent

Run this to start the CLI:

bash
hermes
1

Install WSL2

Install WSL2 first, then run the remaining Hermes commands inside your WSL2 terminal.

powershell
wsl --install
powershell
node --version
2

Install Hermes Agent CLI globally

bash
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
source ~/.bashrc
3

Create the Hermes config file

Write the following to ~/.hermes/config.yaml to persist Router One as the custom endpoint.

bash
mkdir -p ~/.hermes && cat > ~/.hermes/config.yaml <<'EOF'
model:
  provider: custom
  default: gpt-5.6-sol
  base_url: https://api.router.one/v1
  api_key: sk-your-api-key
  context_length: 65536
EOF
OPENAI_BASE_URL is not used by Hermes Agent. Use hermes model or edit ~/.hermes/config.yaml directly.
4

Launch Hermes Agent

Run this to start the CLI:

bash
hermes
1

Install Python and pip

Hermes Agent installs with pip. Windows users should run Hermes inside WSL2.

bash
python3 --version
python3 -m pip --version

Or via apt (Debian/Ubuntu):

bash
sudo apt update && sudo apt install -y python3 python3-pip
2

Install Hermes Agent CLI globally

bash
pip install hermes-agent
hermes postinstall
3

Create the Hermes config file

Write the following to ~/.hermes/config.yaml to persist Router One as the custom endpoint.

bash
mkdir -p ~/.hermes && cat > ~/.hermes/config.yaml <<'EOF'
model:
  provider: custom
  default: gpt-5.6-sol
  base_url: https://api.router.one/v1
  api_key: sk-your-api-key
  context_length: 65536
EOF
OPENAI_BASE_URL is not used by Hermes Agent. Use hermes model or edit ~/.hermes/config.yaml directly.
4

Launch Hermes Agent

Run this to start the CLI:

bash
hermes