Guides
Roo Code
Keep an existing Roo Code install running on the MiniRouter catalog.
Roo Code is a VS Code agent with modes such as Code, Architect and Ask. Add MiniRouter as an OpenAI Compatible provider to run each mode on any tool-capable model in the catalog, with one balance and per-key spend limits.
1. Create a key
Create a key for Roo Code.
2. Check the key
Export the key as MINIROUTER_KEY, then send one request. A JSON reply means the key and balance work.
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. Add the provider
Open Roo Code sidebar → ⚙ Settings → Providers and fill in:
| 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 | zai/glm-5.3-flashAny catalog id. Save one config profile per model. |
4. Send a prompt
Ask Roo anything, then open Request logs. The request lists its model, tokens and exact cost.
A profile per mode
Roo saves a model per config profile and remembers the last profile used in each mode.
- In Settings → Providers, press + for each model.
- Name it after the model, for example MiniRouter Sol.
- Use the same base URL and key; change only Model.
- Switch to a mode and pick its profile from the dropdown in chat.
| Mode | Model ID |
|---|---|
| Architect | openai/gpt-5.6-solStronger reasoning for plans. |
| Code | zai/glm-5.3-flashCheaper model for edits. |
Pick a model that calls tools
| Model ID | Uses |
|---|---|
| zai/ | Strong agentic model at low cost. See GLM 5.3 Flash. |
| minirouter/ | Picks a model with reliable tool calling. See Auto router. |
| @preset/ | Your saved models and instructions. See Presets. |
A preset lets you change a profile's model from the dashboard without opening Roo.
Keep spend in check
- Profile rate limitSeconds between requests, set per profile.
- Key spend capDaily or monthly cap on the key.
- Request logsEvery request and its cost.
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.
Different modes hit different models than expected
Roo remembers a config profile per mode (Code, Architect, Ask…), and each profile holds its own model. Check which profile the current mode uses.
Every error code, with its fix: Errors.