CodeRoute Harness Setup Guide
CodeRoute exposes OpenAI-compatible model access for coding agents:
Base URL: https://coderoute.ai/v1
Model: coding-auto
API key: your CODEROUTE_API_KEY
Most OpenAI-compatible clients use /v1/chat/completions. Current OpenAI Codex CLI should use wire_api = "responses", which sends traffic to CodeRoute's /v1/responses adapter.
Start with coding-auto. On pchomelab it prefers the dedicated 4090 Qwen workhorse first, then hosted GLM-5.2 through OpenRouter for GLM-class fallback. Use coding-glm-local only when you explicitly want the slower Mac Studio Q3_K_M route, coding-ornith-local when you explicitly want the Mac Studio Ornith 1.0 35B agentic coding route, and coding-gpt55 when you explicitly want GPT-5.5.
Get Your API Key
export CODEROUTE_API_KEY="$(ssh pchomelab 'sudo 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-cheap | Cheapest capable route for docs, summaries, and small edits. |
coding-local | Local-only work. Avoids cloud fallback. |
coding-balanced | Balanced-tier models for refactors, debugging, and tests. |
coding-strong | Strong-tier route. Lets CodeRoute choose hosted GLM-5.2, GPT-5.5, or an available local strong model. |
coding-glm-openrouter | Hosted GLM-5.2 through OpenRouter for faster/full-model testing. |
coding-glm-local | Homelab-only Mac Studio GLM-5.2 Q3_K_M route through LM Studio. |
coding-ornith-local | Homelab-only Mac Studio Ornith 1.0 35B agentic coding route through LM Studio. |
coding-gpt55 | GPT-5.5 through the OpenAI cloud route for highest-risk work. |
coding-review | Security review, final review, and risk-heavy checks. |
coding-qwen3-coder-free | Free OpenRouter Qwen3 Coder route for long-context coding tests. |
coding-north-mini-code-free | Free OpenRouter Cohere North Mini Code route for fast edits and docs. |
coding-laguna-xs-free | Free OpenRouter Poolside Laguna XS route for cheap/simple coding tasks. |
coding-laguna-m-free | Free OpenRouter Poolside Laguna M route for balanced coding-agent work. |
coding-nemotron-super-free | Free OpenRouter Nemotron Super route for long-context reasoning and review. |
coding-gpt-oss-120b-free | Free OpenRouter gpt-oss-120b route for strong reasoning checks. |
coding-qwen-next-free | Free OpenRouter Qwen3 Next route for stable general/code work. |
coding-gemma-4-26b-free | Free OpenRouter Gemma 4 26B route for docs and multimodal-capable tasks. |
Free OpenRouter routes are external aggregator-cloud calls. They are handy for dev and smoke tests, but expect free-model rate limits: 20 requests per minute, plus daily limits based on the OpenRouter account.
Adaptive aliases such as coding-auto, coding-balanced, coding-local, coding-strong, and coding-review retry the next allowed candidate after retryable provider failures such as network errors, 429, and 5xx. Fixed aliases such as coding-glm-openrouter, coding-glm-local, coding-ornith-local, coding-gpt55, and named *-free routes stay on the requested route.
Live Validation Status
Validated on July 2, 2026:
| Check | Result |
|---|---|
Direct coding-auto | Passed, now configured to prefer workhorse on the dedicated 4090 before hosted GLM fallback. |
Direct coding-balanced | Passed, selected studio-qwen3.6-27b on the Mac Studio. |
Direct coding-local | Passed, selected studio-qwen3.6-27b on the Mac Studio. |
Direct coding-cheap | Passed, selected studio-gemma-4-e4b on the Mac Studio. |
Direct coding-strong | Passed, selected studio-glm-5.2-q3-k-m on the Mac Studio. |
Direct coding-glm-local | Passed after LM Studio loaded model id glm-5.2. |
Direct coding-ornith-local | Passed with Mac Studio LM Studio model id ornith-1.0-35b. |
Direct coding-glm-openrouter | Passed, selected openrouter-glm-5.2. |
Direct coding-gpt55 | Passed, selected cloud-openai-gpt55. |
| Direct free OpenRouter routes | coding-qwen3-coder-free and coding-qwen-next-free reached CodeRoute but returned upstream 502 during validation, consistent with OpenRouter free-provider limits. |
| OpenCode | Passed with opencode run --model coderoute/coding-glm-openrouter. |
| Codex CLI | Passed with codex exec --sandbox read-only -m coding-glm-openrouter and wire_api = "responses". |
| Aider | Passed with uvx --python 3.12 --from aider-chat aider 0.86.2 and openai/coding-glm-openrouter. Python 3.13 hit Aider audio dependency import errors. |
| Claude Code | Passed with Claude Code 2.1.196, ANTHROPIC_BASE_URL=https://coderoute.ai/anthropic, and --model sonnet. |
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-cheap": { "name": "CodeRoute Cheap", "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-glm-local": { "name": "CodeRoute GLM 5.2 Local", "tools": true },
"coding-ornith-local": { "name": "CodeRoute Ornith Local", "tools": true },
"coding-gpt55": { "name": "CodeRoute GPT-5.5", "tools": true },
"coding-review": { "name": "CodeRoute Review", "tools": true },
"coding-qwen3-coder-free": { "name": "CodeRoute Qwen3 Coder Free", "tools": true },
"coding-north-mini-code-free": { "name": "CodeRoute North Mini Code Free", "tools": true },
"coding-laguna-xs-free": { "name": "CodeRoute Laguna XS Free", "tools": true },
"coding-laguna-m-free": { "name": "CodeRoute Laguna M Free", "tools": true },
"coding-nemotron-super-free": { "name": "CodeRoute Nemotron Super Free", "tools": true },
"coding-gpt-oss-120b-free": { "name": "CodeRoute GPT OSS 120B Free", "tools": true },
"coding-qwen-next-free": { "name": "CodeRoute Qwen Next Free", "tools": true },
"coding-gemma-4-26b-free": { "name": "CodeRoute Gemma 4 26B Free", "tools": true }
}
}
}
}
Run OpenCode:
export CODEROUTE_API_KEY="$(ssh pchomelab 'sudo docker exec coderoute-coderoute-api-1 printenv CODEROUTE_API_KEY')"
opencode
In OpenCode, use /models and pick CodeRoute Auto, CodeRoute Strong, or CodeRoute Ornith Local.
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."
Mac Studio GLM-5.2 Q3_K_M smoke test:
opencode run --model coderoute/coding-glm-local \
"Do not edit files. Reply with the model route you are using."
Mac Studio Ornith 1.0 35B smoke test:
opencode run --model coderoute/coding-ornith-local \
"Do not edit files. Reply with the model route you are using."
GPT-5.5 smoke test:
opencode run --model coderoute/coding-gpt55 \
"Do not edit files. Reply with the model route you are using."
Free model smoke test:
opencode run --model coderoute/coding-qwen3-coder-free \
"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 user-level Codex config, usually ~/.codex/config.toml:
model = "coding-auto"
model_provider = "coderoute"
[model_providers.coderoute]
name = "CodeRoute"
base_url = "https://coderoute.ai/v1"
env_key = "CODEROUTE_API_KEY"
wire_api = "responses"
Run Codex from your project:
export CODEROUTE_API_KEY="$(ssh pchomelab 'sudo docker exec coderoute-coderoute-api-1 printenv CODEROUTE_API_KEY')"
codex
One-shot smoke tests:
codex exec --sandbox read-only \
-m coding-glm-openrouter \
"Do not edit files or run commands. Reply exactly: codex coderoute ok"
For a focused premium-model session, pass -m coding-gpt55. For the local Mac Studio GLM route, pass -m coding-glm-local.
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.
Manual smoke checklist:
1. Select the OpenAI Compatible provider. 2. Set the base URL to https://coderoute.ai/v1 and model to coding-glm-openrouter. 3. Send: Do not edit files. Reply exactly: cline coderoute ok. 4. Confirm the response is exact, then check /dashboard or /v1/coderoute/usage?client_name=cline for the request if Cline sends an identifiable user agent or metadata.
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 |
For explicit free-model testing, use coding-qwen3-coder-free for coding, coding-laguna-m-free for debugging/refactors, or coding-nemotron-super-free for review.
Manual smoke checklist:
1. Select the OpenAI Compatible provider. 2. Set the base URL to https://coderoute.ai/v1 and model to coding-glm-openrouter. 3. Send: Do not edit files. Reply exactly: roo coderoute ok. 4. Confirm the response is exact, then check /dashboard or /v1/coderoute/usage?client_name=roo for the request if Roo sends an identifiable user agent or metadata.
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
If Aider is not installed locally, run it through uvx with Python 3.12:
uvx --python 3.12 --from aider-chat aider \
--model openai/coding-glm-openrouter \
--openai-api-base https://coderoute.ai/v1 \
--openai-api-key "$CODEROUTE_API_KEY" \
--message "Do not edit files. Reply exactly: aider coderoute ok" \
--exit \
--dry-run \
--no-auto-commits \
--no-auto-lint \
--no-gitignore
On the July 2 validation host, Aider 0.86.2 failed under Python 3.13 because of missing audioop/pyaudioop imports, then passed under Python 3.12.
For a stronger pass:
export AIDER_MODEL=openai/coding-strong
For a free OpenRouter pass:
export AIDER_MODEL=openai/coding-qwen3-coder-free
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.
Use coding-qwen3-coder-free or coding-laguna-m-free when you want to explicitly test a free OpenRouter route.
Claude Code
CodeRoute exposes a first-pass Anthropic Messages facade at /anthropic/v1/messages. Claude Code 2.1.196 expands --model sonnet to claude-sonnet-4-6; CodeRoute maps that compatibility alias to hosted GLM-5.2.
Bare no-tools smoke, validated July 2, 2026:
ANTHROPIC_API_KEY="$CODEROUTE_API_KEY" \
ANTHROPIC_BASE_URL=https://coderoute.ai/anthropic \
claude --bare --print \
--model sonnet \
--tools "" \
--permission-mode dontAsk \
--no-session-persistence \
"Do not edit files or run commands. Reply exactly: claude coderoute ok"
Current caveats:
- The facade supports non-streaming messages, synthesized Anthropic SSE streams, and basic tool-use/tool-result translation.
- This is a compatibility bridge to CodeRoute aliases and non-Claude models, not a Claude-native feature parity promise.
- Keep long-running Claude Code edit sessions experimental until more edit-loop smoke tests are captured.
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. - Mac Studio local GLM unavailable: on the Mac Studio, run
lms server start --bind 0.0.0.0andlms load glm-5.2 --identifier glm-5.2, then retrycoding-glm-local. - Mac Studio local Ornith unavailable: on the Mac Studio, run
lms server start --bind 0.0.0.0andlms load ornith-1.0-35b --identifier ornith-1.0-35b, then retrycoding-ornith-local. - Empty local GLM or Ornith answer on a tiny smoke test: raise the output-token cap. These local reasoning models emit hidden reasoning first; use at least
256for local GLM smoke tests, at least768for local Ornith smoke tests, and a few thousand tokens for agent work. - Budget exceeded in OpenCode: lower the model output-token cap, usually
limit.outputormaxOutputTokens. Good starting caps are4096forcoding-glm-openrouterand2048forcoding-gpt55. - Free model limit errors: OpenRouter
:freemodels are rate-limited; switch back tocoding-auto,coding-local, or a paid hosted route if you hit429or upstream502. - Claude Code direct setup: use
ANTHROPIC_BASE_URL=https://coderoute.ai/anthropic;--model sonnetmaps to CodeRoute'sclaude-sonnet-4-6compatibility alias.