@blockrun/clawrouter 0.12.39 โ†’ 0.12.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,17 +2,19 @@
2
2
 
3
3
  <img src="assets/banner.png" alt="ClawRouter Banner" width="600">
4
4
 
5
- <h3>The agent-native LLM router for <a href="https://openclaw.ai">OpenClaw</a></h3>
5
+ <h1>The LLM router built for autonomous agents</h1>
6
6
 
7
- Route every request to the right model at the right price.<br>
8
- 15-dimension scoring, <1ms local routing, optimized for autonomous agents.<br>
9
- One wallet, 41+ models, zero API keys.
7
+ <p>Agents can't sign up for accounts. Agents can't enter credit cards.<br>
8
+ Agents can only sign transactions.<br><br>
9
+ <strong>ClawRouter is the only LLM router that lets agents operate independently.</strong></p>
10
10
 
11
- <img src="https://img.shields.io/badge/๐Ÿš€_92%25_Cost_Savings-success?style=for-the-badge" alt="92% savings">&nbsp;
11
+ <br>
12
+
13
+ <img src="https://img.shields.io/badge/๐Ÿค–_Agent--Native-black?style=for-the-badge" alt="Agent native">&nbsp;
12
14
  <img src="https://img.shields.io/badge/๐Ÿ”‘_Zero_API_Keys-blue?style=for-the-badge" alt="No API keys">&nbsp;
13
- <img src="https://img.shields.io/badge/๐Ÿค–_41+_Models-purple?style=for-the-badge" alt="41+ models">&nbsp;
14
- <img src="https://img.shields.io/badge/๐Ÿ’ฐ_Non--Custodial-orange?style=for-the-badge" alt="Non-custodial">&nbsp;
15
- <img src="https://img.shields.io/badge/โšก_<1ms_Routing-yellow?style=for-the-badge" alt="Fast routing">
15
+ <img src="https://img.shields.io/badge/โšก_Local_Routing-yellow?style=for-the-badge" alt="Local routing">&nbsp;
16
+ <img src="https://img.shields.io/badge/๐Ÿ’ฐ_x402_USDC-purple?style=for-the-badge" alt="x402 USDC">&nbsp;
17
+ <img src="https://img.shields.io/badge/๐Ÿ”“_Open_Source-green?style=for-the-badge" alt="Open source">
16
18
 
17
19
  [![npm version](https://img.shields.io/npm/v/@blockrun/clawrouter.svg?style=flat-square&color=cb3837)](https://npmjs.com/package/@blockrun/clawrouter)
18
20
  [![npm downloads](https://img.shields.io/npm/dm/@blockrun/clawrouter.svg?style=flat-square&color=blue)](https://npmjs.com/package/@blockrun/clawrouter)
@@ -32,27 +34,43 @@ One wallet, 41+ models, zero API keys.
32
34
 
33
35
  ---
34
36
 
35
- ## ๐Ÿ“‘ Quick Navigation
37
+ ## Why ClawRouter exists
38
+
39
+ 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.
40
+
41
+ **Agents can't do any of that.**
42
+
43
+ ClawRouter is built for the agent-first world:
44
+
45
+ - **No accounts** โ€” a wallet is generated locally, no signup
46
+ - **No API keys** โ€” your wallet signature IS authentication
47
+ - **No model selection** โ€” 15-dimension scoring picks the right model automatically
48
+ - **No credit cards** โ€” agents pay per-request with USDC via [x402](https://x402.org)
49
+ - **No trust required** โ€” runs locally, <1ms routing, zero external dependencies
50
+
51
+ This is the stack that lets agents operate autonomously: **x402 + USDC + local routing**.
52
+
53
+ ---
54
+
55
+ ## How it compares
36
56
 
37
- | Section | Description |
38
- | ----------------------------------------- | ------------------------------- |
39
- | [Quick Start](#-quick-start) | Install in 2 minutes |
40
- | [Routing Profiles](#-routing-profiles) | eco / auto / premium / free |
41
- | [Image Generation](#-image-generation) | /imagegen with 5 models |
42
- | [How It Works](#-how-it-works) | 15-dimension local routing |
43
- | [Models & Pricing](#-models--pricing) | 41+ models, full price list |
44
- | [Screenshots](#-screenshots) | See it in action |
45
- | [Payment](#-payment) | x402 non-custodial USDC |
46
- | [Configuration](#%EF%B8%8F-configuration) | Environment variables |
47
- | [Troubleshooting](#-troubleshooting) | `doctor` AI-powered diagnostics |
48
- | [vs OpenRouter](#-vs-openrouter) | Why ClawRouter wins |
49
- | [Support](#-support) | Telegram, X, founders |
57
+ | | OpenRouter | LiteLLM | Martian | Portkey | **ClawRouter** |
58
+ | ---------------- | ----------------- | ---------------- | ----------------- | ----------------- | ----------------------- |
59
+ | **Models** | 200+ | 100+ | Smart routing | Gateway | **41+** |
60
+ | **Routing** | Manual selection | Manual selection | Smart (closed) | Observability | **Smart (open source)** |
61
+ | **Auth** | Account + API key | Your API keys | Account + API key | Account + API key | **Wallet signature** |
62
+ | **Payment** | Credit card | BYO keys | Credit card | $49-499/mo | **USDC per-request** |
63
+ | **Runs locally** | No | Yes | No | No | **Yes** |
64
+ | **Open source** | No | Yes | No | Partial | **Yes** |
65
+ | **Agent-ready** | No | No | No | No | **Yes** |
50
66
 
51
- **API Docs:** [Image Generation & Editing](docs/image-generation.md) ยท [Architecture](docs/architecture.md) ยท [Configuration](docs/configuration.md)
67
+ โœ“ Open source ยท โœ“ Smart routing ยท โœ“ Runs locally ยท โœ“ Crypto native ยท โœ“ Agent ready
68
+
69
+ **We're the only one that checks all five boxes.**
52
70
 
53
71
  ---
54
72
 
55
- ## ๐Ÿš€ Quick Start
73
+ ## Quick Start
56
74
 
57
75
  ```bash
58
76
  # 1. Install with smart routing enabled
@@ -63,11 +81,11 @@ openclaw gateway restart
63
81
  # $5 is enough for thousands of requests
64
82
  ```
65
83
 
66
- Done! Smart routing (`blockrun/auto`) is now your default model.
84
+ Done. Smart routing (`blockrun/auto`) is now your default model.
67
85
 
68
86
  ---
69
87
 
70
- ## ๐ŸŽฏ Routing Profiles
88
+ ## Routing Profiles
71
89
 
72
90
  Choose your routing strategy with `/model <profile>`:
73
91
 
@@ -82,7 +100,26 @@ Choose your routing strategy with `/model <profile>`:
82
100
 
83
101
  ---
84
102
 
85
- ## ๐ŸŽจ Image Generation
103
+ ## How It Works
104
+
105
+ **100% local routing. <1ms latency. Zero external API calls.**
106
+
107
+ ```
108
+ Request โ†’ Weighted Scorer (15 dimensions) โ†’ Tier โ†’ Best Model โ†’ Response
109
+ ```
110
+
111
+ | Tier | ECO Model | AUTO Model | PREMIUM Model |
112
+ | --------- | ----------------------------------- | ---------------------------- | ---------------------------- |
113
+ | SIMPLE | nvidia/gpt-oss-120b (FREE) | kimi-k2.5 ($0.60/$3.00) | kimi-k2.5 |
114
+ | MEDIUM | gemini-2.5-flash-lite ($0.10/$0.40) | grok-code-fast ($0.20/$1.50) | gpt-5.2-codex ($1.75/$14.00) |
115
+ | COMPLEX | gemini-2.5-flash-lite ($0.10/$0.40) | gemini-3.1-pro ($2/$12) | claude-opus-4.6 ($5/$25) |
116
+ | REASONING | grok-4-fast ($0.20/$0.50) | grok-4-fast ($0.20/$0.50) | claude-sonnet-4.6 ($3/$15) |
117
+
118
+ **Blended average: $2.05/M** vs $25/M for Claude Opus = **92% savings**
119
+
120
+ ---
121
+
122
+ ## Image Generation
86
123
 
87
124
  Generate images directly from chat with `/imagegen`:
88
125
 
@@ -100,16 +137,13 @@ Generate images directly from chat with `/imagegen`:
100
137
  | `gpt-image` | OpenAI GPT Image 1 | $0.02/image | 1536x1024 |
101
138
  | `flux` | Black Forest Flux 1.1 | $0.04/image | 1024x1024 |
102
139
 
103
- Default model: `nano-banana`. Images are returned as hosted URLs for compatibility with Telegram, Discord, and other clients.
104
-
105
- ## โœ๏ธ Image Editing (img2img)
140
+ ## Image Editing (img2img)
106
141
 
107
- Edit existing images with `/img2img` โ€” pass a local file and describe what to change:
142
+ Edit existing images with `/img2img`:
108
143
 
109
144
  ```
110
145
  /img2img --image ~/photo.png change the background to a starry sky
111
146
  /img2img --image ./cat.jpg --mask ./mask.png remove the background
112
- /img2img --image /tmp/portrait.png --size 1536x1024 add a hat
113
147
  ```
114
148
 
115
149
  | Option | Required | Description |
@@ -119,40 +153,11 @@ Edit existing images with `/img2img` โ€” pass a local file and describe what to
119
153
  | `--model <model>` | No | Model to use (default: `gpt-image-1`) |
120
154
  | `--size <WxH>` | No | Output size (default: `1024x1024`) |
121
155
 
122
- Supported model: `gpt-image-1` (OpenAI GPT Image 1, $0.02/image).
123
-
124
- **API endpoint:** `POST http://localhost:8402/v1/images/image2image` โ€” accepts local file paths, URLs, or base64 data URIs:
125
-
126
- ```bash
127
- curl -X POST http://localhost:8402/v1/images/image2image \
128
- -H "Content-Type: application/json" \
129
- -d '{"prompt":"add sunglasses","image":"~/photo.png"}'
130
- ```
131
-
132
- See [Image Generation & Editing docs](docs/image-generation.md#post-v1imagesimage2image) for full API reference and code examples.
156
+ **API endpoint:** `POST http://localhost:8402/v1/images/image2image` โ€” see [full docs](docs/image-generation.md#post-v1imagesimage2image).
133
157
 
134
158
  ---
135
159
 
136
- ## โšก How It Works
137
-
138
- **100% local routing. <1ms latency. Zero external API calls.**
139
-
140
- ```
141
- Request โ†’ Weighted Scorer (15 dimensions) โ†’ Tier โ†’ Cheapest Model โ†’ Response
142
- ```
143
-
144
- | Tier | ECO Model | AUTO Model | PREMIUM Model |
145
- | --------- | ----------------------------------- | ---------------------------- | ---------------------------- |
146
- | SIMPLE | nvidia/gpt-oss-120b (FREE) | kimi-k2.5 ($0.60/$3.00) | kimi-k2.5 |
147
- | MEDIUM | gemini-2.5-flash-lite ($0.10/$0.40) | grok-code-fast ($0.20/$1.50) | gpt-5.2-codex ($1.75/$14.00) |
148
- | COMPLEX | gemini-2.5-flash-lite ($0.10/$0.40) | gemini-3.1-pro ($2/$12) | claude-opus-4.6 ($5/$25) |
149
- | REASONING | grok-4-fast ($0.20/$0.50) | grok-4-fast ($0.20/$0.50) | claude-sonnet-4.6 ($3/$15) |
150
-
151
- **Blended average: $2.05/M** vs $25/M for Claude Opus = **92% savings**
152
-
153
- ---
154
-
155
- ## ๐Ÿ’ฐ Models & Pricing
160
+ ## Models & Pricing
156
161
 
157
162
  41+ models across 7 providers, one wallet:
158
163
 
@@ -199,31 +204,7 @@ Request โ†’ Weighted Scorer (15 dimensions) โ†’ Tier โ†’ Cheapest Model โ†’ Resp
199
204
 
200
205
  ---
201
206
 
202
- ## ๐Ÿ“ธ Screenshots
203
-
204
- <table>
205
- <tr>
206
- <td width="50%" align="center">
207
- <strong>Smart Routing in Action</strong><br><br>
208
- <img src="docs/clawrouter-savings.png" alt="ClawRouter savings" width="400">
209
- </td>
210
- <td width="50%" align="center">
211
- <strong>Telegram Integration</strong><br><br>
212
- <img src="assets/telegram-demo.png" alt="Telegram demo" width="400">
213
- </td>
214
- </tr>
215
- </table>
216
-
217
- **The flow:**
218
-
219
- 1. **Wallet auto-generated** on Base (L2) โ€” saved at `~/.openclaw/blockrun/wallet.key`
220
- 2. **Fund with $1 USDC** โ€” enough for hundreds of requests
221
- 3. **Request any model** โ€” ClawRouter picks the cheapest capable one
222
- 4. **Pay per request** โ€” non-custodial, you hold your keys
223
-
224
- ---
225
-
226
- ## ๐Ÿ’ณ Payment
207
+ ## Payment
227
208
 
228
209
  No account. No API key. **Payment IS authentication** via [x402](https://x402.org).
229
210
 
@@ -231,9 +212,9 @@ No account. No API key. **Payment IS authentication** via [x402](https://x402.or
231
212
  Request โ†’ 402 (price: $0.003) โ†’ wallet signs USDC โ†’ retry โ†’ response
232
213
  ```
233
214
 
234
- USDC stays in your wallet until spent - non-custodial. Price is visible in the 402 header before signing.
215
+ USDC stays in your wallet until spent โ€” non-custodial. Price is visible in the 402 header before signing.
235
216
 
236
- **Dual-chain support:** Pay with **USDC** on **Base (EVM)** or **USDC on Solana** โ€” no SOL token accepted. Both wallets are derived from a single BIP-39 mnemonic on first run.
217
+ **Dual-chain support:** Pay with **USDC** on **Base (EVM)** or **USDC on Solana**. Both wallets are derived from a single BIP-39 mnemonic on first run.
237
218
 
238
219
  ```bash
239
220
  /wallet # Check balance and address (both chains)
@@ -251,11 +232,28 @@ USDC stays in your wallet until spent - non-custodial. Price is visible in the 4
251
232
  - **Base (EVM):** Send USDC on Base to your EVM address
252
233
  - **Solana:** Send USDC on Solana to your Solana address
253
234
  - **Coinbase/CEX:** Withdraw USDC to either network
254
- - **Credit card:** Don't have USDC? Reach out to [@bc1max on Telegram](https://t.me/bc1max) โ€” we accept credit card payments
235
+ - **Credit card:** Reach out to [@bc1max on Telegram](https://t.me/bc1max)
255
236
 
256
237
  ---
257
238
 
258
- ## โš™๏ธ Configuration
239
+ ## Screenshots
240
+
241
+ <table>
242
+ <tr>
243
+ <td width="50%" align="center">
244
+ <strong>Smart Routing in Action</strong><br><br>
245
+ <img src="docs/clawrouter-savings.png" alt="ClawRouter savings" width="400">
246
+ </td>
247
+ <td width="50%" align="center">
248
+ <strong>Telegram Integration</strong><br><br>
249
+ <img src="assets/telegram-demo.png" alt="Telegram demo" width="400">
250
+ </td>
251
+ </tr>
252
+ </table>
253
+
254
+ ---
255
+
256
+ ## Configuration
259
257
 
260
258
  For basic usage, no configuration needed. For advanced options:
261
259
 
@@ -270,22 +268,7 @@ For basic usage, no configuration needed. For advanced options:
270
268
 
271
269
  ---
272
270
 
273
- ## ๐ŸฅŠ vs OpenRouter
274
-
275
- | | OpenRouter / LiteLLM | ClawRouter |
276
- | --------------- | --------------------------- | -------------------------------- |
277
- | **Setup** | Human creates account | Agent generates wallet |
278
- | **Auth** | API key (shared secret) | Wallet signature (cryptographic) |
279
- | **Payment** | Prepaid balance (custodial) | Per-request (non-custodial) |
280
- | **Routing** | Proprietary / closed | Open source, client-side |
281
- | **Rate limits** | Per-key quotas | None (your wallet, your limits) |
282
- | **Cost** | $25/M (Opus equivalent) | $2.05/M blended average |
283
-
284
- **[Full comparison โ†’](docs/vs-openrouter.md)**
285
-
286
- ---
287
-
288
- ## ๐Ÿฉบ Troubleshooting
271
+ ## Troubleshooting
289
272
 
290
273
  **When things go wrong, run the doctor:**
291
274
 
@@ -333,7 +316,7 @@ npx @blockrun/clawrouter doctor opus "ๆทฑๅบฆๅˆ†ๆžๆˆ‘็š„้…็ฝฎ"
333
316
 
334
317
  ---
335
318
 
336
- ## ๐Ÿ›  Development
319
+ ## Development
337
320
 
338
321
  ```bash
339
322
  git clone https://github.com/BlockRunAI/ClawRouter.git
@@ -345,7 +328,7 @@ npm test
345
328
 
346
329
  ---
347
330
 
348
- ## ๐Ÿ“ž Support
331
+ ## Support
349
332
 
350
333
  | Channel | Link |
351
334
  | --------------------- | ------------------------------------------------------------------ |
@@ -357,7 +340,40 @@ npm test
357
340
 
358
341
  ---
359
342
 
360
- ## ๐Ÿ“š More Resources
343
+ ## From the BlockRun Ecosystem
344
+
345
+ <table>
346
+ <tr>
347
+ <td width="50%">
348
+
349
+ ### โšก ClawRouter
350
+
351
+ **The LLM router built for autonomous agents**
352
+
353
+ You're here. 41+ models, local smart routing, x402 USDC payments โ€” the only stack that lets agents operate independently.
354
+
355
+ `curl -fsSL https://blockrun.ai/ClawRouter-update | bash`
356
+
357
+ </td>
358
+ <td width="50%">
359
+
360
+ ### ๐Ÿฆž [SocialClaw](https://github.com/BlockRunAI/socialclaw)
361
+
362
+ **Intelligence-as-a-function for X/Twitter**
363
+
364
+ The first X analytics an agent can call. One function call = one intelligence report. $0.08, not $49/month. No dashboard, no login, no subscription.
365
+
366
+ `pip install blockrun-llm[solana]`
367
+
368
+ [![GitHub](https://img.shields.io/github/stars/BlockRunAI/socialclaw?style=flat-square)](https://github.com/BlockRunAI/socialclaw)
369
+
370
+ </td>
371
+ </tr>
372
+ </table>
373
+
374
+ ---
375
+
376
+ ## More Resources
361
377
 
362
378
  | Resource | Description |
363
379
  | ------------------------------------------------------ | ------------------------ |
@@ -367,16 +383,14 @@ npm test
367
383
  | [Routing Profiles](docs/routing-profiles.md) | ECO/AUTO/PREMIUM details |
368
384
  | [Architecture](docs/architecture.md) | Technical deep dive |
369
385
  | [Configuration](docs/configuration.md) | Environment variables |
370
- | [vs OpenRouter](docs/vs-openrouter.md) | Why ClawRouter wins |
371
- | [Features](docs/features.md) | All features |
372
386
  | [Troubleshooting](docs/troubleshooting.md) | Common issues |
373
387
 
374
388
  ---
375
389
 
376
390
  <div align="center">
377
391
 
378
- **MIT License** ยท [BlockRun](https://blockrun.ai) โ€” Pay-per-request AI infrastructure
392
+ **MIT License** ยท [BlockRun](https://blockrun.ai) โ€” Agent-native AI infrastructure
379
393
 
380
- โญ If ClawRouter saves you money, consider starring the repo!
394
+ โญ If ClawRouter powers your agents, consider starring the repo!
381
395
 
382
396
  </div>
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node