Guides
Cline
Run the Cline coding agent on any model in the MiniRouter catalog.
Cline is an open-source coding agent for VS Code and the terminal. Its OpenAI Compatible provider sends requests to MiniRouter's Chat Completions endpoint, so Cline runs on any tool-capable model in the catalog, a preset or a router, with one balance and per-key spend limits.
1. Install Cline
Open Extensions with Cmd+Shift+X or Ctrl+Shift+X, search for Cline and click Install.
npm i -g cline2. Check the key
Create a key, export it as MINIROUTER_KEY, then send one request outside Cline.
curl https://api.minirouter.sh/v1/chat/completions \
-H "Authorization: Bearer $MINIROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"zai/glm-5.3-flash","messages":[{"role":"user","content":"ping"}]}'3. Enter the settings
Open Cline sidebar → ⚙ Settings → API Configuration.
| Setting | Value |
|---|---|
| API Provider | OpenAI Compatible |
| Base URL | https://api.minirouter.sh/v1The bare host also works. Never append /chat/completions. |
| API Key | mr-live-… (your key) |
| Model ID | zai/glm-5.3-flashUse an ID from /models. For no-deposit testing, choose minirouter/auto:free when listed; quotas and supported request features apply. |
4. Run a task
Ask Cline for a small change. Then open Request logs. The request lists its model, tokens and exact cost.
Match the context window
- 01OpenModel Configuration under the OpenAI Compatible provider.
- 02CopyContext window and output limit from the model's page in Models.
- 03SaveCline now manages context against the real window.
Plan and Act models
In API Configuration, tick Use different models for Plan and Act modes. Then set a Model ID on each tab.
| Mode | Model ID |
|---|---|
| Plan | openai/gpt-5.6-solStronger reasoning for the plan. |
| Act | zai/glm-5.3-flashCheaper model for the edits. |
Check Request logs after switching modes. Each request shows the model that answered.
Routers and presets
Type any of these into Model ID.
| Model ID | Uses |
|---|---|
| minirouter/ | Picks a model with reliable tool calling. See Auto router. |
| minirouter/ | Picks the model and effort from the request. See Fusion. |
| @preset/ | Your saved models and instructions. Edit them in Presets. |
Cline CLI
cline auth runs the same provider setup as the extension. Choose OpenAI Compatible and enter the values above.
cline auth
cline -m zai/glm-5.3-flash "Run tests and fix failures"| Flag | Does |
|---|---|
| -m | Model ID for this run. |
| -p | Starts in Plan mode. |
| --json | Streams NDJSON. |
| -y | Skips approvals and exits when done. |
Keep spend in check
Restrict models or filter content with Guardrails.
Recommended modelsBrowse every model in the catalog.
| Model | Why |
|---|---|
zai/glm-5.3-flash | Best current balance of coding ability, agentic performance, context and cost. |
openai/gpt-5.6-sol | Higher-intelligence option when task quality matters more than spend. |
spacexai/grok-4.6 | Strong agentic alternative with a 500K-token window. |
google/gemini-3.8-flash | Multimodal coding alternative with a 1M-token window. |
Troubleshooting
404, HTML, or a parse error on every request
Almost always the base URL. Use https://api.minirouter.sh/v1 — the bare host without /v1 also works, but never append /chat/completions to the base URL field; the client adds that path itself.
Error: 400 invalid_request.
401 on every request
Wrong or rotated key. Keys start with mr-live-; after a rotation the old key keeps working for 24 hours, then dies.
Error: 401 invalid_api_key.
402 before any tokens arrive
Balance below the estimated cost of the request. Top up (from $0.50 with direct Solana payments) — and watch the x-minirouter-balance-usd header, the low-balance signal every response carries.
Error: 402 insufficient_credits.
Model picker shows no minirouter models
The OpenAI Compatible provider takes a typed Model ID rather than fetching a list. Type the id exactly, author/name — e.g. zai/glm-5.3-flash.
Every error code, with its fix: Errors.