CodeRoute Harness Setup Guide
CodeRoute exposes one OpenAI-compatible endpoint for coding agents:
Base URL: https://coderoute.ai/v1
Model: coding-auto
API key: your CODEROUTE_API_KEY
Start with coding-auto. Use coding-strong for harder architecture, debugging, and review work.
Get Your API Key
export CODEROUTE_API_KEY="$(ssh pchomelab 'docker exec coderoute-coderoute-api-1 printenv CODEROUTE_API_KEY')"
Do not commit the key to a repo. Prefer environment variables, each harness credential store, or a local ignored .env.
Model Aliases
| Alias | Use it for |
|---|---|
coding-auto | Default route. Lets CodeRoute choose the model. |
coding-local | Local-only work. Avoids cloud fallback. |
coding-balanced | Refactors, debugging, and tests. |
coding-strong | Strong local/frontier route, currently GLM-5.2 Q3_K_M on the Mac Studio. |
coding-glm-openrouter | Hosted GLM-5.2 through OpenRouter for faster/full-model testing. |
coding-review | Security review, final review, and risk-heavy checks. |
OpenCode
Create opencode.json in your project:
{
"$schema": "https://opencode.ai/config.json",
"model": "coderoute/coding-auto",
"small_model": "coderoute/coding-auto",
"provider": {
"coderoute": {
"npm": "@ai-sdk/openai-compatible",
"name": "CodeRoute",
"options": {
"baseURL": "https://coderoute.ai/v1",
"apiKey": "{env:CODEROUTE_API_KEY}"
},
"models": {
"coding-auto": { "name": "CodeRoute Auto", "tools": true },
"coding-local": { "name": "CodeRoute Local", "tools": true },
"coding-balanced": { "name": "CodeRoute Balanced", "tools": true },
"coding-strong": { "name": "CodeRoute Strong", "tools": true },
"coding-glm-openrouter": { "name": "CodeRoute GLM 5.2 Hosted", "tools": true },
"coding-review": { "name": "CodeRoute Review", "tools": true }
}
}
}
}
Run OpenCode:
export CODEROUTE_API_KEY="$(ssh pchomelab 'docker exec coderoute-coderoute-api-1 printenv CODEROUTE_API_KEY')"
opencode
In OpenCode, use /models and pick CodeRoute Auto or CodeRoute Strong.
One-shot CLI smoke test:
opencode run --model coderoute/coding-auto \
"Do not edit files. Reply with exactly: CodeRoute ready"
Hosted GLM-5.2 smoke test:
opencode run --model coderoute/coding-glm-openrouter \
"Do not edit files. Reply with the model route you are using."
OpenAI Codex CLI
Codex supports custom model providers. Add a CodeRoute provider to your Codex config:
model = "coding-auto"
model_provider = "coderoute"
[model_providers.coderoute]
name = "CodeRoute"
base_url = "https://coderoute.ai/v1"
env_key = "CODEROUTE_API_KEY"
wire_api = "chat"
Run Codex from your project:
export CODEROUTE_API_KEY="$(ssh pchomelab 'docker exec coderoute-coderoute-api-1 printenv CODEROUTE_API_KEY')"
codex
For a focused strong-model session, set model = "coding-strong" in a project-local config or pass the equivalent model option your Codex version supports.
Cline
Use the OpenAI-compatible provider:
| Field | Value |
|---|---|
| Provider | OpenAI Compatible |
| Base URL | https://coderoute.ai/v1 |
| API Key | CODEROUTE_API_KEY |
| Model | coding-auto |
Use coding-strong for difficult tasks. If Cline asks for a model list and does not discover aliases automatically, enter the CodeRoute alias manually.
Roo Code
Use Roo's OpenAI-compatible configuration:
| Field | Value |
|---|---|
| API provider | OpenAI Compatible |
| Base URL | https://coderoute.ai/v1 |
| API Key | CODEROUTE_API_KEY |
| Model | coding-auto |
Recommended mode mapping:
| Roo mode | CodeRoute alias |
|---|---|
| Code | coding-auto |
| Architect | coding-strong |
| Debug | coding-balanced |
| Ask | coding-local |
| Review | coding-review |
Cursor
Use Cursor's OpenAI-compatible custom model settings when available:
| Field | Value |
|---|---|
| Base URL | https://coderoute.ai/v1 |
| API Key | CODEROUTE_API_KEY |
| Model | coding-auto |
If Cursor does not allow custom OpenAI-compatible chat models in your installed version or plan, use OpenCode or Codex CLI for CodeRoute-backed agent work and keep Cursor as the editor.
Aider
Use Aider's OpenAI-compatible environment variables:
export AIDER_MODEL=openai/coding-auto
export AIDER_OPENAI_API_BASE=https://coderoute.ai/v1
export AIDER_OPENAI_API_KEY="$CODEROUTE_API_KEY"
aider
For a stronger pass:
export AIDER_MODEL=openai/coding-strong
Continue
Add a custom OpenAI-compatible model to your Continue config:
{
"models": [
{
"title": "CodeRoute Auto",
"provider": "openai",
"model": "coding-auto",
"apiBase": "https://coderoute.ai/v1",
"apiKey": "${CODEROUTE_API_KEY}"
}
]
}
Use coding-balanced or coding-strong for project-level edits and review workflows.
Claude Code
Claude Code is not a first-class CodeRoute client yet because CodeRoute currently exposes an OpenAI-compatible API, while Claude Code expects Anthropic/Claude-compatible provider flows.
Current recommendation:
- Use Claude Code with Anthropic, Bedrock, Vertex, or Foundry for Claude-native work.
- Use OpenCode, Codex CLI, Cline, Roo, Aider, or Continue when you want CodeRoute model routing.
- Treat any Claude Code to non-Claude model bridge as experimental until CodeRoute has an Anthropic-compatible facade and smoke tests.
Planned CodeRoute work:
- Add
/anthropic/v1/messagescompatibility. - Add a
claude-codeclient profile. - Test Claude Code through CodeRoute only with explicit compatibility checks for streaming, tool use, thinking blocks, and long-running edits.
First Prompt For A New Project
Study this repository, identify the app architecture, then propose a short implementation plan. After I approve the plan, make the smallest useful change, run the relevant checks, and summarize what changed.
For a bigger build:
Build the requested feature end to end. Reuse existing patterns, keep changes scoped, run the test/build commands, and stop only when the app is usable or you hit a concrete blocker.
Troubleshooting
401 Unauthorized: refreshCODEROUTE_API_KEY.- Model not found: use CodeRoute aliases like
coding-auto, not provider model names likez-ai/glm-5.2. - Tool call failures: try
coding-strong; some harnesses needtools: truein their model config. - Slow responses: local GLM-5.2 Q3_K_M can be slow. Use
coding-glm-openrouterfor hosted GLM-5.2. - Claude Code direct setup: wait for CodeRoute's Anthropic-compatible facade.