CodeRoute

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

AliasUse it for
coding-autoDefault route. Lets CodeRoute choose the model.
coding-cheapCheapest capable route for docs, summaries, and small edits.
coding-localLocal-only work. Avoids cloud fallback.
coding-balancedBalanced-tier models for refactors, debugging, and tests.
coding-strongStrong-tier route. Lets CodeRoute choose hosted GLM-5.2, GPT-5.5, or an available local strong model.
coding-glm-openrouterHosted GLM-5.2 through OpenRouter for faster/full-model testing.
coding-glm-localHomelab-only Mac Studio GLM-5.2 Q3_K_M route through LM Studio.
coding-ornith-localHomelab-only Mac Studio Ornith 1.0 35B agentic coding route through LM Studio.
coding-gpt55GPT-5.5 through the OpenAI cloud route for highest-risk work.
coding-reviewSecurity review, final review, and risk-heavy checks.
coding-qwen3-coder-freeFree OpenRouter Qwen3 Coder route for long-context coding tests.
coding-north-mini-code-freeFree OpenRouter Cohere North Mini Code route for fast edits and docs.
coding-laguna-xs-freeFree OpenRouter Poolside Laguna XS route for cheap/simple coding tasks.
coding-laguna-m-freeFree OpenRouter Poolside Laguna M route for balanced coding-agent work.
coding-nemotron-super-freeFree OpenRouter Nemotron Super route for long-context reasoning and review.
coding-gpt-oss-120b-freeFree OpenRouter gpt-oss-120b route for strong reasoning checks.
coding-qwen-next-freeFree OpenRouter Qwen3 Next route for stable general/code work.
coding-gemma-4-26b-freeFree 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:

CheckResult
Direct coding-autoPassed, now configured to prefer workhorse on the dedicated 4090 before hosted GLM fallback.
Direct coding-balancedPassed, selected studio-qwen3.6-27b on the Mac Studio.
Direct coding-localPassed, selected studio-qwen3.6-27b on the Mac Studio.
Direct coding-cheapPassed, selected studio-gemma-4-e4b on the Mac Studio.
Direct coding-strongPassed, selected studio-glm-5.2-q3-k-m on the Mac Studio.
Direct coding-glm-localPassed after LM Studio loaded model id glm-5.2.
Direct coding-ornith-localPassed with Mac Studio LM Studio model id ornith-1.0-35b.
Direct coding-glm-openrouterPassed, selected openrouter-glm-5.2.
Direct coding-gpt55Passed, selected cloud-openai-gpt55.
Direct free OpenRouter routescoding-qwen3-coder-free and coding-qwen-next-free reached CodeRoute but returned upstream 502 during validation, consistent with OpenRouter free-provider limits.
OpenCodePassed with opencode run --model coderoute/coding-glm-openrouter.
Codex CLIPassed with codex exec --sandbox read-only -m coding-glm-openrouter and wire_api = "responses".
AiderPassed 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 CodePassed 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:

FieldValue
ProviderOpenAI Compatible
Base URLhttps://coderoute.ai/v1
API KeyCODEROUTE_API_KEY
Modelcoding-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:

FieldValue
API providerOpenAI Compatible
Base URLhttps://coderoute.ai/v1
API KeyCODEROUTE_API_KEY
Modelcoding-auto

Recommended mode mapping:

Roo modeCodeRoute alias
Codecoding-auto
Architectcoding-strong
Debugcoding-balanced
Askcoding-local
Reviewcoding-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:

FieldValue
Base URLhttps://coderoute.ai/v1
API KeyCODEROUTE_API_KEY
Modelcoding-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:

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