Install
openclaw skills install openclaw-smart-routerAutomatically routes AI requests to cost-optimal models based on task complexity and budget, saving 30-50% on model expenses with adaptive learning.
openclaw skills install openclaw-smart-routerSave 30-50% on model costs through intelligent, automatic model selection.
The first OpenClaw skill that automatically routes requests to optimal models based on complexity analysis and budget constraints. Stops you from wasting money on expensive models for simple tasks. Learns from your usage patterns and gets smarter over time.
Free Tier:
Pro Tier (0.5 USDT/month):
claw skill install openclaw-smart-router
# View routing stats
claw router stats
# Analyze complexity
claw router analyze "Your task description..."
# View routing history
claw router history --limit=10
# Show cost savings
claw router savings
# Open dashboard
claw router dashboard
# Subscribe to Pro
claw router subscribe
What makes a task complex?
Examples:
Simple (0.0-0.3) → Haiku:
Medium (0.3-0.6) → Sonnet:
Complex (0.6-0.8) → Opus:
Expert (0.8-1.0) → Opus:
Without Smart Router:
- 100 requests/day to Opus
- $0.015 per request
- Monthly: $45
With Smart Router:
- 30 requests to Haiku ($0.90)
- 50 requests to Sonnet ($7.50)
- 20 requests to Opus ($9.00)
- Monthly: $17.40
Savings: $27.60/month (61%)
Without Smart Router:
- 500 requests/day to GPT-4
- Monthly: $300
With Smart Router:
- 400 to GPT-3.5 ($24)
- 80 to GPT-4-Turbo ($24)
- 20 to GPT-4 ($12)
- Monthly: $60
Savings: $240/month (80%)
Agents can autonomously evaluate if Pro tier is worth it:
Example ROI:
Agent making 100 requests/day:
- Without router: $45/month
- With router: $17.40/month
- Savings: $27.60/month
- Pro cost: $0.50/month
- Net profit: $27.10/month
- ROI: 5,420%
Economic rationale: If routing decisions save more than 0.5 USDT/month in model costs, Pro tier pays for itself. Agent can autonomously pay via x402 without human approval.
See AGENT-PAYMENTS.md for x402 integration details.
Smart Router learns from your usage:
Example Learning:
Pattern detected: "Debug Python errors"
History: Haiku failed 3 times, Sonnet succeeded 5 times
Learning: Always use Sonnet+ for Python debugging
Next time: "Debug this Python error..."
→ Automatically routes to Sonnet instead of Haiku
What it learns:
# Install full efficiency suite
claw skill install openclaw-memory
claw skill install openclaw-context-optimizer
claw skill install openclaw-smart-router
~/.openclaw/openclaw-smart-router/Access web UI at http://localhost:9093:
Smart Router automatically calculates return on investment:
$ claw router savings
Cost Analysis (Last 30 Days)
────────────────────────────────
Routing decisions: 2,847
Average complexity: 0.45
Model distribution:
- Haiku: 42% ($3.60)
- Sonnet: 49% ($21.00)
- Opus: 9% ($11.12)
Total actual cost: $35.72
Without Smart Router: $128.12
Savings: $92.40 (72%)
Pro cost: $0.50/month
Net profit: $91.90/month
ROI: 18,380% 🎉
# Analyze complexity
POST /api/analyze
{
"agent_wallet": "0x...",
"query": "Task description...",
"context_length": 1500
}
# Response:
{
"complexity": 0.65,
"recommended_model": "claude-sonnet-4-5",
"recommended_provider": "anthropic",
"estimated_cost": 0.008,
"reasoning": "Medium complexity code task"
}
# Get routing stats
GET /api/stats?agent_wallet=0x...
# Get savings analysis
GET /api/savings?agent_wallet=0x...
# Get learned patterns
GET /api/patterns?agent_wallet=0x...
# x402 payment endpoints
POST /api/x402/subscribe
POST /api/x402/verify
GET /api/x402/license/:wallet
Smart Router respects your spending limits:
Budget levels:
Budget strategies:
Budget constraint handling:
IF daily_limit_reached:
→ Downgrade to cheapest viable model
→ Warn user about constraint
→ Log budget event
Anthropic:
OpenAI:
Google:
Custom providers:
Smart Router Stats (30 Days)
────────────────────────────────
Total decisions: 2,847
Avg complexity: 0.45
Complexity breakdown:
- Simple (0.0-0.3): 42%
- Medium (0.3-0.6): 37%
- Complex (0.6-0.8): 15%
- Expert (0.8-1.0): 6%
Model distribution:
- Haiku: 1,200 (42%)
- Sonnet: 1,400 (49%)
- Opus: 247 (9%)
Cost: $35.72 (vs $128.12 without)
Savings: 72% ($92.40/month)
Pattern learning:
- 23 patterns identified
- 94% success rate
- 342 pattern applications
Should you upgrade to Pro?
Calculate your potential savings:
Current requests/day × Avg cost per request = Monthly cost
Apply 30-50% savings = Amount saved
If saved amount > 0.5 USDT/month → Pro pays for itself
Typical savings:
ROI gets better with scale.
Built by the OpenClaw community | First smart model router with x402 payments