Get started with CodeRoute
Pick a client to view its setup guide, copy the command, and connect to CodeRoute.
Node.js setup
Install Node.js LTS on Windows, macOS, or Linux, and verify node/npm are available.
Windows
Download the LTS installer from the Node.js website and run it, or use a package manager:
choco install nodejs-ltsscoop install nodejs-ltsmacOS
Download the macOS installer from the Node.js website, or use Homebrew:
brew install nodeLinux
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejscurl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install -y nodejsVerify the install
After installing, run in your terminal:
node --version
npm --versionIf both print versions, Node.js and npm are ready.
Next
With the environment ready, continue to the Claude Code, Codex, or other client guides to connect to CodeRoute.
Claude Code setup
Install and connect Claude Code to CodeRoute with a one-click script. It checks for Node.js and Claude Code, installs them if missing, and writes the config. Copied commands never include your key.
Choose a one-click script by OS
Copy the command for your OS, run it, and enter your API key when prompted.
irm https://coderoute.cc/install/claude-code.ps1 | iexcurl -fsSL https://coderoute.cc/install/claude-code.sh | bashManual install Claude Code
Step 1: Install Claude Code
sudo npm install -g @anthropic-ai/claude-codenpm install -g @anthropic-ai/claude-codecurl -fsSL https://claude.ai/install.sh | bashirm https://claude.ai/install.ps1 | iexVerify the install:
claude --versionStep 2: Configure environment variables
Set the values below in your current terminal or system environment.
Temporary (current session)
$env:ANTHROPIC_BASE_URL = "https://api.coderoute.cc"
$env:ANTHROPIC_AUTH_TOKEN = "your-key"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
cd your-project
claudeexport ANTHROPIC_BASE_URL=https://api.coderoute.cc
export ANTHROPIC_AUTH_TOKEN=your-key
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
cd your-project
claudePersistent
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.coderoute.cc", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your-key", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "1", [System.EnvironmentVariableTarget]::User)echo 'export ANTHROPIC_BASE_URL=https://api.coderoute.cc' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN=your-key' >> ~/.zshrc
echo 'export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1' >> ~/.zshrc
source ~/.zshrcecho 'export ANTHROPIC_BASE_URL=https://api.coderoute.cc' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN=your-key' >> ~/.bashrc
echo 'export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1' >> ~/.bashrc
source ~/.bashrcStep 3: Start using
In your project directory, run:
claudeClaude Code analyzes the current directory and provides intelligent coding help.
See the Anthropic docs for more.
Codex (OpenAI) setup
Install and configure Codex to connect to CodeRoute via ~/.codex.
Choose a one-click script by OS
The script checks for Node.js and the Codex CLI, installs them if missing, then prompts for your API key and writes the ~/.codex config. Copied commands never include your key.
irm https://coderoute.cc/install/codex.ps1 | iexcurl -fsSL https://coderoute.cc/install/codex.sh | bashManual install Codex
Step 1: Install Codex
sudo npm install -g @openai/codex@latestnpm install -g @openai/codex@latestThe command above installs the latest Codex from the npm registry.
codex --versionIf it prints a version, you’re set.
Step 2: Create the config files
Codex uses config files — you need to create config.toml and auth.json.
# Create the config directory (the commands below overwrite existing config — back it up first)
mkdir -p ~/.codex
# Create config.toml
cat > ~/.codex/config.toml << 'EOF'
model_provider = "codex"
model = "gpt-5.6-sol"
review_model = "gpt-5.6-sol"
model_reasoning_effort = "high"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 272000
model_auto_compact_token_limit = 272000
effective_context_window_percent = 95
[model_providers.codex]
name = "codex"
base_url = "https://api.coderoute.cc/v1"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false
http_headers = { "x-openai-actor-authorization" = "coderoute" }
EOF
# Create auth.json
cat > ~/.codex/auth.json << 'EOF'
{
"OPENAI_API_KEY": "YOUR_API_KEY"
}
EOF# Create the config directory (the commands below overwrite existing config — back it up first)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex" | Out-Null
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
# Create config.toml
$config = @'
model_provider = "codex"
model = "gpt-5.6-sol"
review_model = "gpt-5.6-sol"
model_reasoning_effort = "high"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 272000
model_auto_compact_token_limit = 272000
effective_context_window_percent = 95
[model_providers.codex]
name = "codex"
base_url = "https://api.coderoute.cc/v1"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false
http_headers = { "x-openai-actor-authorization" = "coderoute" }
'@
[System.IO.File]::WriteAllText("$env:USERPROFILE\.codex\config.toml", $config, $utf8NoBom)
# Create auth.json
$auth = @'
{
"OPENAI_API_KEY": "YOUR_API_KEY"
}
'@
[System.IO.File]::WriteAllText("$env:USERPROFILE\.codex\auth.json", $auth, $utf8NoBom)Step 3: Start using
In your project directory, run:
codexSee the OpenAI docs for more.
TRAE SOLO setup
Add custom models in TRAE SOLO to connect to the Codex and Claude channels.
Step 1: Open custom model config
- Open Settings
- Add model
- Custom config
Step 2: Fill in by model type
Codex model config
Use https://api.coderoute.cc/v1 for the OpenAI / Codex endpoint.
Claude model config
Use https://api.coderoute.cc for the Claude / Anthropic endpoint.
OpenClaw setup
Connect OpenClaw to CodeRoute. The one-click script lets you pick the Anthropic (Claude) or OpenAI (Codex) channel.
Recommended: interactive one-click script
Run it, pick a channel, enter your API key, and it writes the OpenClaw config.
curl -fsSL https://coderoute.cc/install/openclaw.sh | bashirm https://coderoute.cc/install/openclaw.ps1 | iexManual install OpenClaw
Install globally via npm:
npm install -g @openclaw/cliAnthropic (Claude)
Do not add /v1 to the Claude / Anthropic endpoint. Example model: claude-opus-4-6.
export ANTHROPIC_API_KEY="YOUR_API_KEY"
openclaw onboard --auth-choice custom-api-key \
--custom-base-url https://api.coderoute.cc \
--custom-api-key-env ANTHROPIC_API_KEY \
--custom-compatibility anthropic \
--custom-model claude-opus-4-6OpenAI (Codex)
The OpenAI / Codex endpoint must include /v1. Example model: gpt-5.6-sol.
Step 3: Start using
openclawHermes setup
Connect Hermes to CodeRoute. The one-click script picks a channel and writes the config.
Recommended: interactive one-click script
Run it, pick a channel, enter your API key, and it writes ~/.hermes/config.yaml.
curl -fsSL https://coderoute.cc/install/hermes.sh | bashirm https://coderoute.cc/install/hermes.ps1 | iexManual install Hermes
Install via pipx:
pipx install hermes-agentWrite the config file manually:
mkdir -p ~/.hermes
cat > ~/.hermes/config.yaml << 'EOF'
model:
default: claude-opus-4-7
provider: coderoute-claude
providers:
coderoute-claude:
api_mode: anthropic_messages
base_url: https://api.coderoute.cc
api_key: YOUR_API_KEY
default_model: claude-opus-4-7
models:
- claude-opus-4-7
EOFStep 3: Start using
hermesAPI scripts
Examples covering text, vision, image, and video endpoints. Replace YOUR_API_KEY with your key before running.
OpenAI Responses text + vision
The newer OpenAI endpoint for chat, image understanding, and streaming.
curl https://api.coderoute.cc/v1/responses \
-H "Authorization: Bearer $CODEROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-sol",
"input": "Write a quicksort in Python",
"stream": false
}'OpenAI Chat Completions text + vision
The classic OpenAI Chat format — easy migration for existing clients.
curl https://api.coderoute.cc/v1/chat/completions \
-H "Authorization: Bearer $CODEROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k2.7-code",
"messages": [
{"role": "user", "content": "Write a quicksort in Python"}
]
}'Anthropic Messages text + vision
Claude / Anthropic Messages format; image mode base64-encodes before submit.
curl https://api.coderoute.cc/v1/messages \
-H "x-api-key: $CODEROUTE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Write a quicksort in Python"}
]
}'gpt-image-2 image generation
Text-to-image goes to /v1/images/generations; reference-image edits go to /v1/images/edits.
curl https://api.coderoute.cc/v1/images/generations \
-H "Authorization: Bearer $CODEROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "an orange cat in glasses, pixel art",
"size": "1024x1024"
}'gpt-image-2 image edit
Upload an image and edit per the prompt; save the result via streaming events.
curl https://api.coderoute.cc/v1/images/edits \
-H "Authorization: Bearer $CODEROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"image": {"url": "https://example.com/a.png"},
"prompt": "change the background to a cyberpunk city"
}'{"image": {"url": "..."}}; for local files, use a data URL like data:image/png;base64,<BASE64>.grok-imagine-video video generation
Async video: submit a job to get a request_id, poll until done, then download.
# Submit a generation job
curl https://api.coderoute.cc/v1/videos/generations \
-H "Authorization: Bearer $CODEROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video",
"prompt": "city night timelapse, 4K",
"resolution": "720p",
"duration": 8
}'
# Poll the job status
# GET /v1/videos/{request_id} → returns status and video.url
# When done, download the bytes via GET /v1/videos/{request_id}/contentresolution supports 480p / 720p; duration defaults to 8s, range 1–15s, billed per second. video.url is a temporary signed link — download and save it promptly.
About supported clients
CodeRoute offers both OpenAI- and Anthropic-compatible protocols across GLM, DeepSeek, Kimi and Qwen coding models, so any client that speaks either protocol works (Claude Code, Codex, Cursor, OpenAI SDK, OpenClaw, Hermes, Continue, Cline, and others).
Client config options may change between versions; refer to each client’s official docs. Scan the code to reach the team if you run into setup issues.