Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Automatically routes AI requests to cost-optimal models based on task complexity and budget, saving 30-50% on model expenses with adaptive learning.
Automatically routes AI requests to cost-optimal models based on task complexity and budget, saving 30-50% on model expenses with adaptive learning.
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Save 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.
π― 30-50% Cost Savings - Automatic model selection based on task complexity π§ Complexity Analysis - Scores tasks 0.0-1.0 and selects appropriate model π° Budget Awareness - Respects spending limits and cost targets π Pattern Learning - Learns which models work best for your tasks π Multi-Provider - Works with Anthropic, OpenAI, Google, and more πΈ x402 Payments - Agents can pay for unlimited routing (0.5 USDT/month)
Free Tier: 100 routing decisions per day Automatic complexity analysis Basic model selection Cost tracking Pro Tier (0.5 USDT/month): Unlimited routing decisions Advanced pattern learning Custom routing rules Detailed analytics and ROI tracking Budget optimization
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
Intercepts requests - Hooks before each API call Analyzes complexity - Scores task from 0.0 (simple) to 1.0 (expert) Checks budget - Considers spending limits Selects model - Chooses optimal model: Simple (0.0-0.3) β Haiku/GPT-3.5 Medium (0.3-0.6) β Sonnet/GPT-4-Turbo Complex (0.6-0.8) β Opus/GPT-4 Expert (0.8-1.0) β Opus/GPT-4 Routes request - Sends to selected model Learns from result - Tracks success and adapts
What makes a task complex? Context length (more context = higher complexity) Code presence (code analysis scores higher) Error messages (debugging is complex) Task type (writing < coding < reasoning < research) Question complexity (multiple parts, nested logic) Specificity (vague requests need stronger models) Examples: Simple (0.0-0.3) β Haiku: "What's the current time?" "Format this JSON" "Fix typo in variable name" Medium (0.3-0.6) β Sonnet: "Refactor this class to use interfaces" "Write unit tests for this function" "Explain how React hooks work" Complex (0.6-0.8) β Opus: "Debug this multi-threaded race condition" "Design a scalable caching strategy" "Optimize this algorithm for performance" Expert (0.8-1.0) β Opus: "Design a distributed system architecture" "Solve this novel algorithmic problem" "Research and synthesize from multiple sources"
Reduce model costs by 30-50% automatically Stop manually switching between models Budget-aware routing for cost control Learn optimal model selection from patterns Track spending and ROI over time
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: Task-based patterns (debugging, refactoring, writing) Complexity patterns (what works at different levels) Budget patterns (when to downgrade, when quality matters) Provider patterns (which providers work best for your tasks)
Stores routing patterns as persistent memories Recalls successful model selections across sessions Maximum learning efficiency
Combine for 60-80% total cost reduction Compress context (40-60% token savings) Route to cheaper model (30-50% cost savings) Together = maximum efficiency
Smart Router optimizes model selection Cost Governor enforces hard spending limits Together = maximum cost control # Install full efficiency suite claw skill install openclaw-memory claw skill install openclaw-context-optimizer claw skill install openclaw-smart-router
All data stored locally in ~/.openclaw/openclaw-smart-router/ No external servers or telemetry Routing happens locally (no API calls) Open source - audit the code yourself
Access web UI at http://localhost:9093: Real-time routing decisions Complexity distribution chart Model selection breakdown Cost savings over time ROI calculation Pattern learning insights Budget tracking License status
Node.js 18+ OpenClaw v2026.1.30+ OS: Windows, macOS, Linux Optional: OpenClaw Memory System (recommended) Optional: OpenClaw Context Optimizer (highly recommended)
# 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: Per-request max ($0.50 default) Daily limit ($5.00 default) Monthly limit ($100.00 default) Budget strategies: Conservative: Prefer cheaper models when viable Balanced: Use recommended model, respect hard limits Quality-First: Prioritize best model, soft budget constraints Budget constraint handling: IF daily_limit_reached: β Downgrade to cheapest viable model β Warn user about constraint β Log budget event
Anthropic: claude-haiku-4-5 (simple) claude-sonnet-4-5 (medium) claude-opus-4-5 (complex) OpenAI: gpt-3.5-turbo (simple) gpt-4-turbo (medium) gpt-4 (complex) Google: gemini-1.5-flash (simple) gemini-1.5-pro (medium/complex) Custom providers: Easily configure your own models and costs
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: Light usage (10-20 req/day): $3-8/month β $2.50-7.50 profit Medium usage (50-100 req/day): $20-45/month β $19.50-44.50 profit Heavy usage (200+ req/day): $100+/month β $99.50+ profit ROI gets better with scale.
Full Documentation Routing Guide Agent Payments Guide GitHub Repository ClawHub Page Built by the OpenClaw community | First smart model router with x402 payments
Agent frameworks, memory systems, reasoning layers, and model-native orchestration.
Largest current source with strong distribution and engagement signals.