Guides
Aider
Pair program in your terminal with any model in the MiniRouter catalog.
Aider is a terminal pair programmer that edits files in your git repo and commits each change. Point its OpenAI-compatible mode at MiniRouter to use any model in the catalog, or a router, with one balance and per-key spend limits.
1. Install Aider
curl -LsSf https://aider.chat/install.sh | shpowershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"2. Create a key
Create a key for Aider.
3. Point Aider at MiniRouter
export OPENAI_API_BASE=https://api.minirouter.sh/v1
export OPENAI_API_KEY=mr-live-YOUR-KEY-HERE
aider --model openai/zai/glm-5.3-flashsetx OPENAI_API_BASE https://api.minirouter.sh/v1
setx OPENAI_API_KEY mr-live-YOUR-KEY-HEREOpen a new shell, then run aider --model openai/zai/glm-5.3-flash.
4. Send a prompt
Ask for one change, then open Request logs. The request lists its model, tokens and exact cost.
Switch models
Keep the openai/ prefix in flags and in chat.
| Command | Does |
|---|---|
| / | Switches the main model mid-chat to GPT 5.6 Sol. |
| / | Commit messages and history summaries. |
| --model openai/ | Lets Auto pick a coding model. |
| --model openai/ | Runs a saved preset. |
Save the setup
Put the endpoint and models in .aider.conf.yml, and the key in .env.
openai-api-base: https://api.minirouter.sh/v1
model: openai/zai/glm-5.3-flash
weak-model: openai/minirouter/auto:cheapOPENAI_API_KEY=mr-live-YOUR-KEY-HEREAider loads both from your home directory, the git root, then the current directory. Later files win.
Run headless
--message sends one instruction, applies the edits and exits.
aider --model openai/zai/glm-5.3-flash \
--yes-always \
--message "Add type hints to utils.py" utils.py| Flag | Does |
|---|---|
| --message | Runs one instruction, then exits. |
| --yes-always | Answers yes to every confirmation. |
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
Aider warns the model is unknown and guesses a context window
Expected for custom endpoints — Aider's local metadata does not know our ids. The warning is cosmetic; requests still work.
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.
Every error code, with its fix: Errors.