iblai-openclaw-routerCost-optimizing model router for OpenClaw. Automatically routes each request to the cheapest capable Claude model (Haiku/Sonnet/Opus) using weighted scoring....
Install via ClawdBot CLI:
clawdbot install Neuralshift1/iblai-openclaw-routerA zero-dependency proxy that sits between OpenClaw and the Anthropic API, routing each request to the cheapest capable model using a 14-dimension weighted scorer (<1ms overhead).
Run the install script to set up everything automatically:
bash "$(dirname "$0")/scripts/install.sh"
This will:
server.js and config.json to ~/.openclaw/workspace/router/iblai-router) on port 8402iblai-router/auto as an OpenClaw model providerAfter install, iblai-router/auto is available anywhere OpenClaw accepts a model ID.
curl -s http://127.0.0.1:8402/health | jq .
curl -s http://127.0.0.1:8402/stats | jq .
Set iblai-router/auto as the model for any scope:
| Scope | How |
|---|---|
| Cron job | Set model to iblai-router/auto in job config |
| Subagents | agents.defaults.subagents.model = "iblai-router/auto" |
| Per-session | /model iblai-router/auto |
| All sessions | agents.defaults.model.primary = "iblai-router/auto" |
Tip: Keep the main interactive session on a fixed model (e.g. Opus). Use the router for cron jobs, subagents, and background tasks where cost savings compound.
All config lives in ~/.openclaw/workspace/router/config.json and hot-reloads on save β no restart needed.
Change the models per tier:
{
"models": {
"LIGHT": "claude-3-5-haiku-20241022",
"MEDIUM": "claude-sonnet-4-20250514",
"HEAVY": "claude-opus-4-20250514"
}
}
Set apiBaseUrl to route through OpenRouter:
{
"models": {
"LIGHT": "openai/gpt-4.1-mini",
"MEDIUM": "openai/gpt-4.1",
"HEAVY": "openai/o3"
},
"apiBaseUrl": "https://openrouter.ai/api/v1"
}
Update the API key in the systemd service when switching providers, then systemctl daemon-reload && systemctl restart iblai-router.
Keyword lists control which tier handles a request:
simpleKeywords, relayKeywords β push toward LIGHT (cheap)imperativeVerbs, codeKeywords, agenticKeywords β push toward MEDIUMtechnicalKeywords, reasoningKeywords, domainKeywords β push toward HEAVY (capable)Tune boundaries and weights in config.json to match your workload. See the full README for details.
bash "$(dirname "$0")/scripts/uninstall.sh"
Stops the service, removes the systemd unit, and deletes router files. Reminder: switch any workloads using iblai-router/auto back to a direct model first.
Generated Feb 24, 2026
A SaaS company uses the router to classify and route incoming support tickets. Simple queries like password resets go to Haiku, technical issues go to Sonnet, and complex escalation analysis goes to Opus, cutting API costs by 60%.
A social media platform employs the router to moderate user-generated content. Basic keyword flagging uses Haiku, nuanced policy violations use Sonnet, and appeals or complex context analysis uses Opus, ensuring cost-effective scalability.
A financial services firm uses the router to process daily reports. Simple data extraction tasks go to Haiku, standard summarization to Sonnet, and in-depth trend analysis to Opus, optimizing costs for high-volume document processing.
An e-commerce retailer leverages the router to generate product descriptions. Basic item listings use Haiku, detailed feature highlights use Sonnet, and SEO-optimized creative copy uses Opus, reducing content creation expenses.
A telehealth provider uses the router to handle patient inquiries. General FAQs go to Haiku, symptom descriptions to Sonnet, and complex medical advice triage to Opus, balancing cost and care quality.
Offer a managed routing service to businesses using AI APIs, charging a monthly fee based on usage volume. Clients save 30-50% on model costs while you handle configuration and updates.
Provide consulting services to enterprises for customizing the router's scoring and integrating it into existing AI workflows. Charge per project or hourly for setup and optimization.
License the router technology to AI platform providers or developers, allowing them to rebrand it as part of their own offerings. Generate revenue through licensing fees or revenue-sharing agreements.
π¬ Integration Tip
Start by routing only non-critical background tasks like cron jobs to the router to test cost savings without impacting user-facing features.
Transform AI agents from task-followers into proactive partners that anticipate needs and continuously improve. Now with WAL Protocol, Working Buffer, Autonomous Crons, and battle-tested patterns. Part of the Hal Stack π¦
Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.
Clawdbot documentation expert with decision tree navigation, search scripts, doc fetching, version tracking, and config snippets for all Clawdbot features
Interact with Moltbook social network for AI agents. Post, reply, browse, and analyze engagement. Use when the user wants to engage with Moltbook, check their feed, reply to posts, or track their activity on the agent social network.
OpenClaw CLI wrapper β gateway, channels, models, agents, nodes, browser, memory, security, automation.
MoltGuard β runtime security plugin for OpenClaw agents by OpenGuardrails. Helps users install, register, activate, and check the status of MoltGuard. Use wh...