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.
curl -fsSL https://router.one/install/claude-code.sh | bash -s -- sk-your-api-keyConfig takes effect immediately — run claude to start.
$env:ROUTER_ONE_API_KEY = "sk-your-api-key"; irm https://router.one/install/claude-code.ps1 | iexConfig takes effect immediately — run claude to start.
Review the script before running: /install/claude-code.sh · /install/claude-code.ps1
curl -fsSL https://router.one/install/codex.sh | bash -s -- sk-your-api-keyNew terminals work right away; in the current one, run source ~/.zshrc (or your shell profile) first, then codex.
$env:ROUTER_ONE_API_KEY = "sk-your-api-key"; irm https://router.one/install/codex.ps1 | iexThe 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.
sk-xxx).Install Node.js via Homebrew
Claude Code CLI requires Node.js 22 or later.
brew install nodenode --versionInstall Claude Code CLI globally
npm install -g @anthropic-ai/claude-codeConfigure environment variables
Point Claude Code at Router One as its API endpoint.
rm -rf ~/.claudeTemporary (current terminal session only):
export ANTHROPIC_BASE_URL=https://api.router.one
export ANTHROPIC_AUTH_TOKEN=sk-your-api-keyPermanent (write to shell config):
echo 'export ANTHROPIC_BASE_URL=https://api.router.one' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN=sk-your-api-key' >> ~/.zshrc
source ~/.zshrcLaunch Claude Code
Run this to start the CLI:
claudeInstall Node.js
Download from the Node.js website or use winget.
winget install OpenJS.NodeJS.LTSnode --versionInstall Claude Code CLI globally
npm install -g @anthropic-ai/claude-codeConfigure environment variables
Point Claude Code at Router One as its API endpoint.
Remove-Item -Recurse -Force ~\.claudeTemporary (current PowerShell session only):
$env:ANTHROPIC_BASE_URL = "https://api.router.one"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-api-key"Permanent (system environment variables):
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.router.one", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-your-api-key", "User")Launch Claude Code
Run this to start the CLI:
claudeInstall Node.js
Install Node.js 22+ via a package manager or nvm.
Via nvm (recommended):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
node --versionOr via apt (Debian/Ubuntu):
sudo apt update && sudo apt install -y nodejs npmInstall Claude Code CLI globally
npm install -g @anthropic-ai/claude-codeConfigure environment variables
Point Claude Code at Router One as its API endpoint.
rm -rf ~/.claudeTemporary (current terminal session only):
export ANTHROPIC_BASE_URL=https://api.router.one
export ANTHROPIC_AUTH_TOKEN=sk-your-api-keyPermanent (write to shell config):
echo 'export ANTHROPIC_BASE_URL=https://api.router.one' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN=sk-your-api-key' >> ~/.bashrc
source ~/.bashrcLaunch Claude Code
Run this to start the CLI:
claudeCodex CLI Setup Guide
Configure OpenAI Codex CLI to use Router One as a proxy for unified routing, cost controls, and full observability.
sk-xxx).Install Node.js via Homebrew
Codex CLI requires Node.js 16 or later.
brew install nodenode --versionInstall Codex CLI globally
npm install -g @openai/codexConfigure environment variables
Point Codex at Router One as its API endpoint.
Temporary (current terminal session only):
export ROUTER_ONE_API_KEY=sk-your-api-keyPermanent (write to shell config):
echo 'export ROUTER_ONE_API_KEY=sk-your-api-key' >> ~/.zshrc
source ~/.zshrcCreate the Codex config file
Write the following to ~/.codex/config.toml to register Router One as a model provider.
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"
EOFLaunch Codex
Run this to start the CLI:
codexInstall Node.js
Download from the Node.js website or use winget.
winget install OpenJS.NodeJS.LTSnode --versionInstall Codex CLI globally
npm install -g @openai/codexConfigure environment variables
Point Codex at Router One as its API endpoint.
Temporary (current PowerShell session only):
$env:ROUTER_ONE_API_KEY = "sk-your-api-key"Permanent (system environment variables):
[System.Environment]::SetEnvironmentVariable("ROUTER_ONE_API_KEY", "sk-your-api-key", "User")Create the Codex config file
Write the following to %USERPROFILE%\.codex\config.toml to register Router One as a model provider.
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)))Launch Codex
Run this to start the CLI:
codexInstall Node.js
Install Node.js 16+ via a package manager or nvm.
Via nvm (recommended):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
node --versionOr via apt (Debian/Ubuntu):
sudo apt update && sudo apt install -y nodejs npmInstall Codex CLI globally
npm install -g @openai/codexConfigure environment variables
Point Codex at Router One as its API endpoint.
Temporary (current terminal session only):
export ROUTER_ONE_API_KEY=sk-your-api-keyPermanent (write to shell config):
echo 'export ROUTER_ONE_API_KEY=sk-your-api-key' >> ~/.bashrc
source ~/.bashrcCreate the Codex config file
Write the following to ~/.codex/config.toml to register Router One as a model provider.
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"
EOFLaunch Codex
Run this to start the CLI:
codexOpenClaw 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.
sk-xxx).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.
brew install nodenode --versionOr skip this step: the official installer provisions a supported Node.js, installs OpenClaw and then opens its interactive onboarding wizard:
curl -fsSL https://openclaw.ai/install.sh | bashInstall OpenClaw CLI globally
# 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=openclawConfigure environment variables
Point OpenClaw at Router One as its API endpoint.
Temporary (current terminal session only):
export CUSTOM_API_KEY=sk-your-api-keyPermanent (write to shell config):
echo 'export CUSTOM_API_KEY=sk-your-api-key' >> ~/.zshrc
source ~/.zshrcRun 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.
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-daemonLaunch OpenClaw
Onboarding already started the Gateway daemon. Check it, then open the Control UI and send a message:
openclaw gateway status
openclaw dashboardInstall 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.
winget install OpenJS.NodeJS.LTSnode --versionOr skip this step: the official installer provisions a supported Node.js, installs OpenClaw and then opens its interactive onboarding wizard:
iwr -useb https://openclaw.ai/install.ps1 | iexInstall OpenClaw CLI globally
# 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=openclawConfigure environment variables
Point OpenClaw at Router One as its API endpoint.
Temporary (current PowerShell session only):
$env:CUSTOM_API_KEY = "sk-your-api-key"Permanent (system environment variables):
[System.Environment]::SetEnvironmentVariable("CUSTOM_API_KEY", "sk-your-api-key", "User")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.
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-daemonLaunch OpenClaw
Onboarding already started the Gateway daemon. Check it, then open the Control UI and send a message:
openclaw gateway status
openclaw dashboardInstall 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):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install 26
node --versionOr skip this step: the official installer provisions a supported Node.js, installs OpenClaw and then opens its interactive onboarding wizard:
curl -fsSL https://openclaw.ai/install.sh | bashInstall OpenClaw CLI globally
# 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=openclawConfigure environment variables
Point OpenClaw at Router One as its API endpoint.
Temporary (current terminal session only):
export CUSTOM_API_KEY=sk-your-api-keyPermanent (write to shell config):
echo 'export CUSTOM_API_KEY=sk-your-api-key' >> ~/.bashrc
source ~/.bashrcRun 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.
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-daemonLaunch OpenClaw
Onboarding already started the Gateway daemon. Check it, then open the Control UI and send a message:
openclaw gateway status
openclaw dashboardHermes Agent Setup Guide
Install Hermes Agent with its official installer and add Router One as its custom OpenAI-compatible endpoint.
sk-xxx).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).
git --version
curl --versionInstall 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.
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.zshrcAdd 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.
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 OneLaunch Hermes Agent
Run this to start the CLI:
hermesInstall 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.
iex (irm https://hermes-agent.nousresearch.com/install.ps1)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.
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 OneLaunch Hermes Agent
Run this to start the CLI:
hermesCheck 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).
git --version
curl --versionOr via apt (Debian/Ubuntu):
sudo apt update && sudo apt install -y git curlInstall 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.
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.bashrcAdd 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.
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 OneLaunch Hermes Agent
Run this to start the CLI:
hermes