Integrations
OpenHands
Run the OpenHands coding agent on any MiniRouter model.
OpenHands is an autonomous coding agent with a CLI and a web GUI. Point it at MiniRouter to run it on any tool-capable model in the catalog, with per-key spend limits and guardrails.
1. Install OpenHands
uv tool install openhands --python 3.12curl -fsSL https://install.openhands.dev/install.sh | shOn Windows, run these inside WSL.
2. Create a key
Create a key for this agent alone.
3. Set the model
In the GUI, open Settings → LLM and turn on Advanced. In the CLI, run /settings.
- Custom Model
openai/zai/glm-5.3-flashThe openai/ prefix selects the OpenAI-compatible driver; everything after it is our model id, unchanged.- Base URL
https://api.minirouter.sh/v1- API Key
mr-live-… (your key)
export LLM_MODEL=openai/zai/glm-5.3-flash
export LLM_BASE_URL=https://api.minirouter.sh/v1
export LLM_API_KEY=mr-live-YOUR-KEY-HERE
openhands --override-with-envs4. Run a task
openhandsGive it one task, then open Activity. Each request lists its model, tokens and exact cost.
Run headless
Headless mode runs one task with no UI. Use it in scripts and CI, or see Automatic code review.
export LLM_MODEL=openai/zai/glm-5.3-flash
export LLM_BASE_URL=https://api.minirouter.sh/v1
export LLM_API_KEY=mr-live-YOUR-KEY-HERE
openhands --override-with-envs --headless -t "Add unit tests for utils.py"- --headless
- No UI. Needs
-tor--file. - -t
- The task to run.
- --json
- Prints one event per line.
- --override-with-envs
- Uses the
LLM_*variables. Not saved.
Use routers and presets
Put any of these in Custom Model or LLM_MODEL.
Compare tool-capable models on Models.
Contain an autonomous agent
Running several agents? Give each its own key in Keys, so one runaway stops alone.
Recommended modelsBrowse every model in the catalog.
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
LLM provider not found, or the model id is rejected
The openai/ prefix is doing real work — without it the underlying LiteLLM layer tries to guess a provider from the id and fails. Write openai/ followed by our id exactly: openai/zai/glm-5.3-flash.
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.
Credits gone overnight with nothing to show
An agent in a retry loop spends at machine speed. Set dailyLimitNano on the key the agent uses — one key per agent, so a runaway is contained to that key rather than the whole balance.
Error: 402 insufficient_credits.
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.
Every error code, with its fix: Errors.