Skip to content
Skip to content

CLI Setup Guide

One-click setup scripts for Claude Code and Codex CLI that write the base URL and API key, 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 22 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 22+ 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

OpenClaw is a self-hosted AI assistant: a local Gateway daemon that answers you in your chat channels. Register Router One as its custom OpenAI-compatible model provider.

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

Install Node.js via Homebrew

OpenClaw's npm latest (2026.9.8 as of 2026-10-03) requires Node.js 24.16+ or 26.1+, with Node 26 recommended; its runtime guard, as checked against 2026.9.6, reports Node 22 or Node 25 as unsupported.

bash
brew install node
bash
node --version

Or skip this step: the official installer provisions a supported Node.js, installs OpenClaw and then opens its interactive onboarding wizard:

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

Install OpenClaw CLI globally

bash
# npm 12 or npm 11.16+ (check with: npm --version)
npm install -g openclaw@latest --allow-scripts=openclaw
# npm 11.15 or earlier: run the same command without --allow-scripts=openclaw
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 Gateway daemon. --non-interactive requires --accept-risk, which acknowledges OpenClaw's security notice about full system access; without it onboarding stops before writing anything. Onboarding also sends one small test request to the model, which shows up in Dashboard → Logs.

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

Launch OpenClaw

Onboarding already started the Gateway daemon. Check it, then open the Control UI and send a message:

bash
openclaw gateway status
openclaw dashboard
1

Install Node.js

OpenClaw's npm latest (2026.9.8 as of 2026-10-03) requires Node.js 24.16+ or 26.1+, with Node 26 recommended; its runtime guard, as checked against 2026.9.6, reports Node 22 or Node 25 as unsupported.

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

Or skip this step: the official installer provisions a supported Node.js, installs OpenClaw and then opens its interactive onboarding wizard:

powershell
iwr -useb https://openclaw.ai/install.ps1 | iex
2

Install OpenClaw CLI globally

powershell
# npm 12 or npm 11.16+ (check with: npm --version)
npm install -g openclaw@latest --allow-scripts=openclaw
# npm 11.15 or earlier: run the same command without --allow-scripts=openclaw
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 Gateway daemon. --non-interactive requires --accept-risk, which acknowledges OpenClaw's security notice about full system access; without it onboarding stops before writing anything. Onboarding also sends one small test request to the model, which shows up in Dashboard → Logs.

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

Launch OpenClaw

Onboarding already started the Gateway daemon. Check it, then open the Control UI and send a message:

powershell
openclaw gateway status
openclaw dashboard
1

Install Node.js

OpenClaw's npm latest (2026.9.8 as of 2026-10-03) requires Node.js 24.16+ or 26.1+, with Node 26 recommended; its runtime guard, as checked against 2026.9.6, reports Node 22 or Node 25 as unsupported.

Via nvm (recommended):

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

Or skip this step: the official installer provisions a supported Node.js, installs OpenClaw and then opens its interactive onboarding wizard:

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

Install OpenClaw CLI globally

bash
# npm 12 or npm 11.16+ (check with: npm --version)
npm install -g openclaw@latest --allow-scripts=openclaw
# npm 11.15 or earlier: run the same command without --allow-scripts=openclaw
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 Gateway daemon. --non-interactive requires --accept-risk, which acknowledges OpenClaw's security notice about full system access; without it onboarding stops before writing anything. Onboarding also sends one small test request to the model, which shows up in Dashboard → Logs.

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

Launch OpenClaw

Onboarding already started the Gateway daemon. Check it, then open the Control UI and send a message:

bash
openclaw gateway status
openclaw dashboard

Full OpenClaw integration guide →

Hermes Agent Setup Guide

Install Hermes Agent with its official installer and add Router One as its custom OpenAI-compatible endpoint.

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

Check git and curl

Hermes Agent's official installer (checked 2026-10-01) checks for git and curl, and sets up Python, Node.js and Hermes' other dependencies itself. Skip pip: the hermes-agent package on PyPI is still at 0.19.0 (checked 2026-10-01).

bash
git --version
curl --version
2

Install Hermes Agent with the official installer

Run the installer, then reload your shell. When it runs in a terminal, it ends by starting hermes setup, whose Model & Provider step takes the same values as the next step; you can also finish setup first and run hermes model afterwards.

bash
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.zshrc
3

Add Router One as a custom endpoint

Run hermes model outside any chat session, choose Custom endpoint and enter these values. Hermes saves the key to its .env file and the endpoint to ~/.hermes/config.yaml.

bash
hermes model
# Choose Custom endpoint, then answer:
#   API base URL:                   https://api.router.one/v1
#   API key:                        sk-your-api-key
#   Select API compatibility mode:  2 (Chat Completions)
#   Select model … or type name:    anthropic/claude-sonnet-5  (type the exact ID)
#   Context length in tokens:       blank (the full guide covers context length and cost)
#   Display name:                   Router One
OPENAI_BASE_URL is honored only for Hermes' openai-api provider, not for a custom endpoint, so set the URL through hermes model or config.yaml. Chat Completions serves every chat model; the full guide covers named providers, the other transports and the context length. Per Hermes' source (checked 2026-10-31), the main branch has no compression.threshold_tokens default since 2026-09-28: set it in config.yaml; the full guide uses 240000, which keeps anthropic/claude-sonnet-5 requests under the 256,000-token plan quota band. v0.22.5, the release the installer installs, has no default either.
4

Launch Hermes Agent

Run this to start the CLI:

bash
hermes
1

Install Hermes Agent with the official installer

Per Hermes Agent's README (checked 2026-10-01), native Windows is supported: Hermes installs under %LOCALAPPDATA%\hermes. Open a new PowerShell window afterwards. To use WSL2 instead, run the Linux command inside WSL2, where Hermes installs under ~/.hermes.

powershell
iex (irm https://hermes-agent.nousresearch.com/install.ps1)
2

Add Router One as a custom endpoint

Run hermes model outside any chat session, choose Custom endpoint and enter these values. Hermes saves the key to its .env file and the endpoint to %LOCALAPPDATA%\hermes\config.yaml.

powershell
hermes model
# Choose Custom endpoint, then answer:
#   API base URL:                   https://api.router.one/v1
#   API key:                        sk-your-api-key
#   Select API compatibility mode:  2 (Chat Completions)
#   Select model … or type name:    anthropic/claude-sonnet-5  (type the exact ID)
#   Context length in tokens:       blank (the full guide covers context length and cost)
#   Display name:                   Router One
OPENAI_BASE_URL is honored only for Hermes' openai-api provider, not for a custom endpoint, so set the URL through hermes model or config.yaml. Chat Completions serves every chat model; the full guide covers named providers, the other transports and the context length. Per Hermes' source (checked 2026-10-31), the main branch has no compression.threshold_tokens default since 2026-09-28: set it in config.yaml; the full guide uses 240000, which keeps anthropic/claude-sonnet-5 requests under the 256,000-token plan quota band. v0.22.5, the release the installer installs, has no default either.
3

Launch Hermes Agent

Run this to start the CLI:

powershell
hermes
1

Check git and curl

Hermes Agent's official installer (checked 2026-10-01) checks for git and curl, and sets up Python, Node.js and Hermes' other dependencies itself. Skip pip: the hermes-agent package on PyPI is still at 0.19.0 (checked 2026-10-01).

bash
git --version
curl --version

Or via apt (Debian/Ubuntu):

bash
sudo apt update && sudo apt install -y git curl
2

Install Hermes Agent with the official installer

Run the installer, then reload your shell. When it runs in a terminal, it ends by starting hermes setup, whose Model & Provider step takes the same values as the next step; you can also finish setup first and run hermes model afterwards.

bash
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.bashrc
3

Add Router One as a custom endpoint

Run hermes model outside any chat session, choose Custom endpoint and enter these values. Hermes saves the key to its .env file and the endpoint to ~/.hermes/config.yaml.

bash
hermes model
# Choose Custom endpoint, then answer:
#   API base URL:                   https://api.router.one/v1
#   API key:                        sk-your-api-key
#   Select API compatibility mode:  2 (Chat Completions)
#   Select model … or type name:    anthropic/claude-sonnet-5  (type the exact ID)
#   Context length in tokens:       blank (the full guide covers context length and cost)
#   Display name:                   Router One
OPENAI_BASE_URL is honored only for Hermes' openai-api provider, not for a custom endpoint, so set the URL through hermes model or config.yaml. Chat Completions serves every chat model; the full guide covers named providers, the other transports and the context length. Per Hermes' source (checked 2026-10-31), the main branch has no compression.threshold_tokens default since 2026-09-28: set it in config.yaml; the full guide uses 240000, which keeps anthropic/claude-sonnet-5 requests under the 256,000-token plan quota band. v0.22.5, the release the installer installs, has no default either.
4

Launch Hermes Agent

Run this to start the CLI:

bash
hermes

Full Hermes Agent integration guide →