Integrations
OpenClaw
Run your always-on OpenClaw agent on MiniRouter models.
OpenClaw is a personal agent that runs as a background Gateway and answers on chat apps. Register MiniRouter as a provider to run it on any model in the catalog, with fallbacks and a hard spend cap for unattended hours.
1. Install OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bashiwr -useb https://openclaw.ai/install.ps1 | iexnpm install -g openclaw@latest --allow-scripts=openclawThen set up the Gateway.
openclaw onboard --install-daemon2. Save your key
Create a key, then add it to OpenClaw's global env file.
MINIROUTER_KEY=mr-live-YOUR-KEY-HERE3. Add the provider
{
agents: {
defaults: {
model: { primary: "minirouter/zai/glm-5.3-flash" }
}
},
models: {
providers: {
minirouter: {
baseUrl: "https://api.minirouter.sh/v1",
apiKey: "${MINIROUTER_KEY}",
api: "openai-completions",
timeoutSeconds: 300,
// cost is OpenClaw's own accounting field, in USD per million
// tokens. Copy the current rates for each model you add from
// https://minirouter.sh/models rather than leaving these stale.
models: [
{
id: "zai/glm-5.3-flash",
name: "GLM 5.3 Flash (minirouter)",
reasoning: true,
input: ["text", "image"],
cost: { input: 0.1575, output: 0.525 },
contextWindow: 1000000,
maxTokens: 131000
}
]
}
}
}
}4. Restart and verify
openclaw gateway restart
openclaw models statusMessage the agent once, then open Activity. The request lists its model, tokens and exact cost.
Add more models
List every model the agent may use, including routers and presets.
{
models: {
providers: {
minirouter: {
models: [
{ id: "zai/glm-5.3-flash", name: "GLM 5.3 Flash" },
{ id: "openai/gpt-5.6-luna", name: "GPT-5.6 Luna" },
{ id: "minirouter/auto", name: "MiniRouter Auto" },
{ id: "@preset/my-agent", name: "My preset" }
]
}
}
}
}- minirouter/
auto - A model Auto picks. Tool calls get a tool-capable one.
Copy rates for OpenClaw's cost field from each model page.
Switch models
- /
model minirouter/ openai/ gpt-5. 6-luna - This chat session.
- /
model minirouter/ openai/ gpt-5. 6-luna -g - The global default.
- openclaw models set minirouter/
zai/ glm-5. 3-flash - Agent default, from the shell.
- openclaw models fallbacks add minirouter/
openai/ gpt-5. 6-luna - Next model when the primary fails.
Run headless
openclaw agent exec runs one task without a Gateway, against your normal config. It exits 0 on success.
openclaw agent exec "Summarize today's unread email" \
--model minirouter/zai/glm-5.3-flash \
--fallback minirouter/openai/gpt-5.6-luna \
--jsonKeep spend in check
- Own keyOne key for this agent.
- Spend capDaily or monthly limit on that key.
- Utility modelSet
agents.defaults.utilityModelto a cheaper MiniRouter model for titles and recaps. - ActivityEvery request and its cost.
OpenClaw's cost figures come from the cost you configure. Your real charge is in Usage.
Recommended modelsBrowse every model in the catalog.
zai/glm-5.3-flash- Strong agentic performance at a low input rate for repeated tool schemas.
openai/gpt-5.6-luna- Low-cost, high-intelligence alternative for routine agent turns.
deepseek/deepseek-v4-flash-0731- Lowest input rate among the high-scoring long-context candidates.
tencent/hy3- Lower-capability fallback with inexpensive input for high-volume loops.
Troubleshooting
Provider loads but every model call 404s
Paste https://api.minirouter.sh/v1 complete, including the /v1. These clients treat the base URL as the OpenAI-compatible root and append /chat/completions themselves, so trimming the /v1 leaves them calling a path that does not exist.
Error: 400 invalid_request.
Model not found, or "not allowed by agents.defaults.modelPolicy.allow"
Add the model to models.providers.minirouter.models with a matching id. If modelPolicy.allow is set, add minirouter/* to it. Refs are provider/author/name, e.g. minirouter/zai/glm-5.3-flash.
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.
The agent goes quiet mid-conversation in a chat channel
The balance reached $0 mid-stream. The stream ends with a terminal error naming the exact charge for tokens already delivered — but you are reading it inside WhatsApp or Telegram, where there is no UI but the message itself, which is why that error carries a URL.
Error: 402 insufficient_credits.
Every error code, with its fix: Errors.