The agent-native LLM router for OpenClaw. 41+ models, <1ms routing, USDC payments on Base & Solana via x402.
Subagents6.2k stars544 forks● TypeScriptMITUpdated today
ClaudeWave Trust Score
100/100
Passed
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Healthy fork ratio
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
Last scanned: 4/14/2026
Install in Claude Desktop
Method detected: NPX · @blockrun/clawrouter
{
"mcpServers": {
"clawrouter": {
"command": "npx",
"args": ["-y", "@blockrun/clawrouter"]
}
}
}1. Copy the snippet above.
2. Paste into
~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows).3. Replace any
<placeholder> values with your API keys or paths.4. Restart Claude Desktop. The MCP server appears automatically.
Use cases
🧠 AI / ML💰 Finance🎨 Creative
About
Subagents overview
<div align="center">
<img src="assets/banner.png" alt="ClawRouter Banner" width="600">
<h1>The LLM router built for autonomous agents</h1>
<p>Agents can't sign up for accounts. Agents can't enter credit cards.<br>
Agents can only sign transactions.<br><br>
<strong>ClawRouter is the only LLM router that lets agents operate independently.</strong></p>
<br>
<img src="https://img.shields.io/badge/🤖_Agent--Native-black?style=for-the-badge" alt="Agent native">
<img src="https://img.shields.io/badge/🔑_Zero_API_Keys-blue?style=for-the-badge" alt="No API keys">
<img src="https://img.shields.io/badge/⚡_Local_Routing-yellow?style=for-the-badge" alt="Local routing">
<img src="https://img.shields.io/badge/💰_x402_USDC-purple?style=for-the-badge" alt="x402 USDC">
<img src="https://img.shields.io/badge/🔓_Open_Source-green?style=for-the-badge" alt="Open source">
[](https://npmjs.com/package/@blockrun/clawrouter)
[](https://npmjs.com/package/@blockrun/clawrouter)
[](https://github.com/BlockRunAI/ClawRouter)
[](https://github.com/BlockRunAI/ClawRouter/actions)
[](https://typescriptlang.org)
[](LICENSE)
[](https://x.com/USDC/status/2021625822294216977)
[](https://x402.org)
[](https://base.org)
[](https://solana.com)
[](https://openclaw.ai)
[](https://t.me/blockrunAI)
</div>
> **ClawRouter** is an open-source smart LLM router that reduces AI API costs by up to 92%. It analyzes each request across 15 dimensions and routes to the cheapest capable model in under 1ms, entirely locally. ClawRouter is the only LLM router built for autonomous AI agents — it uses wallet signatures for authentication (no API keys) and USDC micropayments via the x402 protocol (no credit cards). 55+ models from OpenAI, Anthropic, Google, xAI, DeepSeek, and more. MIT licensed.
---
## Why ClawRouter exists
Every other LLM router was built for **human developers** — create an account, get an API key, pick a model from a dashboard, pay with a credit card.
**Agents can't do any of that.**
ClawRouter is built for the agent-first world:
- **No accounts** — a wallet is generated locally, no signup
- **No API keys** — your wallet signature IS authentication
- **No model selection** — 15-dimension scoring picks the right model automatically
- **No credit cards** — agents pay per-request with USDC via [x402](https://x402.org)
- **No trust required** — runs locally, <1ms routing, zero external dependencies
This is the stack that lets agents operate autonomously: **x402 + USDC + local routing**.
---
## How it compares
| | OpenRouter | LiteLLM | Martian | Portkey | **ClawRouter** |
| ---------------- | ----------------- | ---------------- | ----------------- | ----------------- | ----------------------- |
| **Models** | 200+ | 100+ | Smart routing | Gateway | **55+** |
| **Routing** | Manual selection | Manual selection | Smart (closed) | Observability | **Smart (open source)** |
| **Auth** | Account + API key | Your API keys | Account + API key | Account + API key | **Wallet signature** |
| **Payment** | Credit card | BYO keys | Credit card | $49-499/mo | **USDC per-request** |
| **Runs locally** | No | Yes | No | No | **Yes** |
| **Open source** | No | Yes | No | Partial | **Yes** |
| **Agent-ready** | No | No | No | No | **Yes** |
✓ Open source · ✓ Smart routing · ✓ Runs locally · ✓ Crypto native · ✓ Agent ready
**We're the only one that checks all five boxes.**
---
## Quick Start
### Option A — OpenClaw Agent
[OpenClaw](https://openclaw.ai) is an AI coding agent. If you're using it, ClawRouter installs as a plugin:
```bash
curl -fsSL https://blockrun.ai/ClawRouter-update | bash
openclaw gateway restart
```
Done. Smart routing (`blockrun/auto`) is now your default model.
### Option B — Standalone (continue.dev, Cursor, VS Code, any OpenAI-compatible client)
> **Using Claude Code?** Check out [BRCC](https://github.com/BlockRunAI/brcc) — it's purpose-built for Claude Code with the same smart routing and x402 payments.
No OpenClaw required. ClawRouter runs as a local proxy on port 8402.
**1. Start the proxy**
```bash
npx @blockrun/clawrouter
```
**2. Fund your wallet**
Your wallet address is printed on first run. Send a few USDC on Base or Solana — $5 covers thousands of requests.
**3. Point your client at `http://localhost:8402`**
<details>
<summary><strong>continue.dev</strong> — <code>~/.continue/config.yaml</code></summary>
> **Important:** `apiBase` must end with `/v1/` (including the trailing slash). Without it, continue.dev constructs the URL as `/chat/completions` instead of `/v1/chat/completions`, and the proxy returns 404.
```yaml
models:
- name: ClawRouter Auto
provider: openai
model: blockrun/auto
apiBase: http://localhost:8402/v1/
apiKey: x402
roles:
- chat
- edit
- apply
```
To pin a specific model, replace `blockrun/auto` with any model from [blockrun.ai/models](https://blockrun.ai/models), e.g. `anthropic/claude-opus-4.6`, `xai/grok-4-0709`.
Both `provider: openai` and `provider: clawrouter` work — just make sure `apiBase` ends with `/v1/`.
<details>
<summary>Legacy JSON format (<code>~/.continue/config.json</code>)</summary>
```json
{
"models": [
{
"title": "ClawRouter Auto",
"provider": "openai",
"model": "blockrun/auto",
"apiBase": "http://localhost:8402/v1/",
"apiKey": "x402"
}
]
}
```
</details>
</details>
<details>
<summary><strong>Cursor</strong> — Settings → Models → OpenAI-compatible</summary>
Set base URL to `http://localhost:8402`, API key to `x402`, model to `blockrun/auto`.
</details>
<details>
<summary><strong>Any OpenAI SDK</strong></summary>
```python
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8402", api_key="x402")
response = client.chat.completions.create(model="blockrun/auto", messages=[...])
```
</details>
---
## Routing Profiles
Choose your routing strategy with `/model <profile>`:
| Profile | Strategy | Savings | Best For |
| ---------------- | ------------------ | ------- | ---------------- |
| `/model auto` | Balanced (default) | 74-100% | General use |
| `/model eco` | Cheapest possible | 95-100% | Maximum savings |
| `/model premium` | Best quality | 0% | Mission-critical |
**Shortcuts:** `/model grok`, `/model br-sonnet`, `/model gpt5`, `/model o3`
---
## How It Works
**100% local routing. <1ms latency. Zero external API calls.**
```
Request → Weighted Scorer (15 dimensions) → Tier → Best Model → Response
```
| Tier | ECO Model | AUTO Model | PREMIUM Model |
| --------- | ----------------------------------- | ------------------------------------- | ---------------------------- |
| SIMPLE | nvidia/gpt-oss-120b (**FREE**) | gemini-2.5-flash ($0.30/$2.50) | kimi-k2.5 |
| MEDIUM | gemini-3.1-flash-lite ($0.25/$1.50) | kimi-k2.5 ($0.60/$3.00) | gpt-5.3-codex ($1.75/$14.00) |
| COMPLEX | gemini-3.1-flash-lite ($0.25/$1.50) | gemini-3.1-pro ($2/$12) | claude-opus-4.6 ($5/$25) |
| REASONING | grok-4-1-fast ($0.20/$0.50) | grok-4-1-fast-reasoning ($0.20/$0.50) | claude-sonnet-4.6 ($3/$15) |
**Blended average: $2.05/M** vs $25/M for Claude Opus = **92% savings**
---
## Image Generation
Generate images directly from chat with `/imagegen`:
```
/imagegen a dog dancing on the beach
/imagegen --model dall-e-3 a futuristic city at sunset
/imagegen --model banana-pro --size 2048x2048 mountain landscape
```
| Model | Provider | Price | Max Size |
| ------------- | --------------------- | ----------- | --------- |
| `nano-banana` | Google Gemini Flash | $0.05/image | 1024x1024 |
| `banana-pro` | Google Gemini Pro | $0.10/image | 4096x4096 |
| `dall-e-3` | OpenAI DALL-E 3 | $0.04/image | 1792x1024 |
| `gpt-image` | OpenAI GPT Image 1 | $0.02/image | 1536x1024 |
| `flux` | Black Forest Flux 1.1 | $0.04/image | 1024x1024 |
## Image Editing (img2img)
Edit existing images with `/img2img`:
```
/img2img --image ~/photo.png change the background to a starry sky
/img2img --image ./cat.jpg --mask ./mask.png remove the background
```
| Option | Required | Description |
| ----Topics
aiai-agentsanthropiccost-optimizationdeepseekgeminillmllm-routermicropaymentsopenaiopenclawsmart-routingstablecoin-paymentstablecoin-paymentsusdcx402
Related
More Subagents
affaan-m
everything-claude-code
·73
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
155.8k24.2kJavaScript· yesterday
Subagentsai-agentsanthropic
Snailclimb
JavaGuide
✓91
Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
154.9k46.2kJava· yesterday
Subagentsagentcontext-engineering
langgenius
dify
✓97
Production-ready platform for agentic workflow development.
137.8k21.6kTypeScript· today
Subagentsagentagentic-ai
langchain-ai
langchain
✓94
The agent engineering platform
133.5k22.1kPython· today
Subagentsagentsai
NousResearch
hermes-agent
✓76
The agent that grows with you
83.5k11.2kPython· today
Subagentsaiai-agent
infiniflow
ragflow
✓95
RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge RAG with Agent capabilities to create a superior context layer for LLMs
78k8.8kPython· today
Subagentsagentagentic