Documentation Index
Fetch the complete documentation index at: https://continue-docs-dependabot-npm-and-yarn-docs-multi-c8c89d9539.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
ClawRouter is an open-source LLM router that automatically selects the cheapest capable model for each request based on prompt complexity, providing 78-96% cost savings.
Installation
ClawRouter runs locally and provides an OpenAI-compatible API:http://localhost:1337.
You can also install it globally:
Configuration
- YAML
- JSON (Deprecated)
config.yaml
Available Models
ClawRouter provides four routing profiles:| Model | Savings | Description | Best For |
|---|---|---|---|
blockrun/auto | 74-100% | Balanced routing based on prompt complexity | General use (recommended) |
blockrun/eco | 95-100% | Cheapest possible models | Maximum savings |
blockrun/premium | 0% | Best quality models (Opus, GPT-5.4 Pro) | Mission-critical tasks |
blockrun/free | 100% | Free-tier models only (nvidia/gpt-oss-120b) | Zero cost testing |
anthropic/claude-sonnet-4.6, openai/gpt-5.4, xai/grok-4).
How It Works
ClawRouter uses a 15-dimension prompt complexity scoring system to analyze each request:- Simple requests (greetings, basic Q&A, simple edits) → routed to cheap models like Claude Haiku or Gemini Flash
- Medium requests (code explanations, refactoring) → routed to balanced models like Claude Sonnet or GPT-4o-mini
- Complex requests (architecture design, complex debugging) → routed to capable models like Claude Opus or GPT-4o
Complexity Dimensions
The router analyzes prompts across dimensions including:- Code complexity and language detection
- Reasoning depth required
- Context length and dependencies
- Domain expertise needed
- Output format requirements
Model Capabilities
ClawRouter supports function calling and tool use through its underlying model providers. Capabilities are automatically inherited from the routed model.- YAML
- JSON (Deprecated)
config.yaml
Switching Between Routing Profiles
Add multiple ClawRouter profiles to your config and switch via Continue’s model picker:- YAML
- JSON (Deprecated)
config.yaml
Custom API Base
If you’re running ClawRouter on a different port or host:- YAML
- JSON (Deprecated)
config.yaml
Using Multiple Roles
You can configure ClawRouter for different Continue roles:- YAML
- JSON (Deprecated)
config.yaml
API Keys
ClawRouter manages upstream provider API keys internally. You configure them in ClawRouter, not in Continue. For self-hosted setups with custom authentication:- YAML
- JSON (Deprecated)
config.yaml
Wallet & Payment Setup
ClawRouter supports crypto-native payments via the x402 protocol. On first run, ClawRouter automatically generates a wallet:Payment Options
| Tier | Description | Payment Required |
|---|---|---|
blockrun/free | Free-tier models only | No |
blockrun/eco | Economy models | Yes (low cost) |
blockrun/auto | Automatic routing | Yes (pay-per-use) |
Funding Your Wallet
ClawRouter supports both Solana and EVM wallets:Spend Controls
Set daily/monthly spending limits:Error Handling
ClawRouter handles common LLM errors automatically at the router level:Automatic Error Recovery
| Error | Continue’s Default | ClawRouter’s Handling |
|---|---|---|
| 429 Rate Limit | Retry same provider with backoff | Route to different provider entirely |
| 402 Payment Required | Fail immediately | x402 auto-payment from wallet |
| 500+ Server Error | Retry same provider | Fallback to next model in tier |
| Timeout | Retry same provider | Route to faster model |
Response Headers
ClawRouter adds diagnostic headers to every response:Troubleshooting
Connection Refused
If you see connection errors, make sure ClawRouter is running:Model Not Found
If a specific model isn’t available, check that ClawRouter has the required provider API keys configured. Runclawrouter --help for configuration options.
Slow Responses
ClawRouter adds minimal latency (~10-50ms) for routing decisions. If responses are slow, the issue is likely with the upstream provider. Try a different model tier (blockrun/eco vs blockrun/auto).
AI-Powered Diagnostics
Run the doctor command for AI-analyzed troubleshooting:Cost Monitoring
ClawRouter provides cost tracking via response headers:x-clawrouter-cost— Cost of the requestx-clawrouter-model— Model that handled the requestx-clawrouter-complexity— Computed complexity score
Dual-Chain Wallet Support
ClawRouter supports payments on two chains from a single wallet:| Chain | Token | Best For |
|---|---|---|
| Base (EVM) | USDC | Lower fees, Coinbase integration |
| Solana | USDC | Fastest settlement |
Model Exclusion
Block specific models from routing:Comparison with OpenRouter
| Feature | ClawRouter | OpenRouter |
|---|---|---|
| Hosting | Self-hosted (local) | Cloud-hosted |
| Automatic routing | ✅ Complexity-based | ❌ Manual selection |
| Cost optimization | ✅ 78-96% savings | ❌ Pay per model |
| Privacy | ✅ Data stays local | ⚠️ Data sent to cloud |
| Authentication | Wallet signature | API key |
| Payment | USDC (Solana/Base) | Credit card |
| Setup | npx clawrouter | Account signup |
ClawRouter can be used alongside OpenRouter — route complex tasks through ClawRouter while using OpenRouter for specific model access.