@blockrun/clawrouter 0.12.267 β†’ 0.12.269

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
@@ -7,13 +7,15 @@
7
7
  <p>Agents can't sign up for accounts. Agents can't enter credit cards.<br>
8
8
  Agents can only sign transactions.<br><br>
9
9
  <strong>ClawRouter is the only LLM router that lets agents operate independently.</strong><br><br>
10
- <em><!-- br:models.free -->7<!-- /br:models.free --> models free, no crypto required. No signup. No API key. No credit card.</em></p>
10
+ <em>Pay however you like: <strong>credit card</strong> (API key, via <a href="https://user.blockrun.ai">user.blockrun.ai</a>)<br>
11
+ or <strong>USDC</strong> on Base or Solana (x402 wallet, no account at all).<br>
12
+ Or neither β€” <!-- br:models.free -->7<!-- /br:models.free --> models are free, with no signup, no key and no wallet.</em></p>
11
13
 
12
14
  <br>
13
15
 
14
16
  <img src="https://img.shields.io/badge/πŸ†“_7_Free_Models-success?style=for-the-badge" alt="7 free models">&nbsp;
15
17
  <img src="https://img.shields.io/badge/πŸ€–_Agent--Native-black?style=for-the-badge" alt="Agent native">&nbsp;
16
- <img src="https://img.shields.io/badge/πŸ”‘_Zero_API_Keys-blue?style=for-the-badge" alt="No API keys">&nbsp;
18
+ <img src="https://img.shields.io/badge/πŸ’³_Card_or_USDC-blue?style=for-the-badge" alt="Card or USDC">&nbsp;
17
19
  <img src="https://img.shields.io/badge/⚑_Local_Routing-yellow?style=for-the-badge" alt="Local routing">&nbsp;
18
20
  <img src="https://img.shields.io/badge/πŸ’°_x402_USDC-purple?style=for-the-badge" alt="x402 USDC">&nbsp;
19
21
  <img src="https://img.shields.io/badge/πŸ”“_Open_Source-green?style=for-the-badge" alt="Open source">
@@ -34,7 +36,24 @@ Agents can only sign transactions.<br><br>
34
36
 
35
37
  </div>
36
38
 
37
- > **ClawRouter** is an open-source smart LLM router that reduces AI API costs by up to <!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->%. It analyzes each request across <!-- br:clawrouter.dimensions -->15<!-- /br:clawrouter.dimensions --> 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). <!-- br:models.chatVisible -->76<!-- /br:models.chatVisible --> models from OpenAI, Anthropic, Google, xAI, DeepSeek, and more. MIT licensed.
39
+ > **ClawRouter** is an open-source smart LLM router that reduces AI API costs by up to <!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->%. It analyzes each request across <!-- br:clawrouter.dimensions -->15<!-- /br:clawrouter.dimensions --> dimensions and routes to the cheapest capable model in under 1ms, entirely locally. It is the only LLM router that an autonomous agent can pay for by itself β€” a wallet signature is the account, and USDC micropayments over the x402 protocol are the billing β€” and it takes an ordinary credit card too: sign up at [user.blockrun.ai](https://user.blockrun.ai), top up, and run the same router on an API key. <!-- br:models.chatVisible -->76<!-- /br:models.chatVisible --> models from OpenAI, Anthropic, Google, xAI, DeepSeek, and more. MIT licensed.
40
+
41
+ ---
42
+
43
+ ## What BlockRun is
44
+
45
+ > **BlockRun lets agents pay for the outcome β€” every LLM, tool and data source, best value per dollar.**
46
+
47
+ Not a seat, not a subscription, not a monthly minimum you keep paying while the agent idles. An agent asks for one thing β€” an answer, an image, a transcript, a price, a call placed β€” and pays for that one thing at the moment it happens. Nothing to sign up for, nothing to cancel.
48
+
49
+ | | |
50
+ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51
+ | **Every LLM** | <!-- br:models.chatVisible -->76<!-- /br:models.chatVisible --> chat models across 9 providers, behind one endpoint and one balance |
52
+ | **Every tool** | <!-- br:models.image -->9<!-- /br:models.image --> image models, <!-- br:models.video -->8<!-- /br:models.video --> video models, music, <!-- br:models.speech -->5<!-- /br:models.speech --> voices, img2img editing, and outbound phone calls that come back as transcripts |
53
+ | **Every data source** | web, news and neural search; prediction markets; live crypto and equity quotes; on-chain SQL over 100M+ labeled wallets; DEX routing; RPC across <!-- br:chains.rpc -->40<!-- /br:chains.rpc --> chains |
54
+ | **Best value per dollar** | <!-- br:clawrouter.dimensions -->15<!-- /br:clawrouter.dimensions -->-dimension local routing sends each request to the cheapest model that can actually do it β€” <!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->% below pinning Claude Opus 5 on the same traffic, computed from a published workload mix rather than estimated |
55
+
56
+ **ClawRouter is how an agent reaches it.** BlockRun is the gateway and the billing; ClawRouter is the MIT-licensed router that runs on your machine, decides which model each request deserves, and settles the bill β€” a wallet signature in USDC, or a credit-card-funded API key. The rest of this README is about ClawRouter.
38
57
 
39
58
  ---
40
59
 
@@ -47,14 +66,26 @@ Every other LLM router was built for **human developers** β€” create an account,
47
66
  ClawRouter is built for the agent-first world:
48
67
 
49
68
  - **Starts at $0** β€” <!-- br:models.free -->7<!-- /br:models.free --> open-weight models are free forever (incl. a 1M-context reasoner and two sub-second coders). Image turns route to paid models β€” see the free-tier note below.
50
- - **No accounts** β€” a wallet is generated locally, no signup
51
- - **No API keys** β€” your wallet signature IS authentication
69
+ - **No accounts needed** β€” a wallet is generated locally, no signup
70
+ - **No API keys needed** β€” your wallet signature IS authentication
52
71
  - **No model selection** β€” <!-- br:clawrouter.dimensions -->15<!-- /br:clawrouter.dimensions -->-dimension scoring + constraint-first ranking ([router-core](https://github.com/BlockRunAI/router-core)) picks the right model automatically
53
- - **No credit cards** β€” agents pay per-request with USDC via [x402](https://x402.org)
72
+ - **No credit card needed** β€” agents pay per-request with USDC via [x402](https://x402.org)
54
73
  - **No trust required** β€” runs locally, <1ms routing, zero external dependencies
55
74
 
56
75
  This is the stack that lets agents operate autonomously: **x402 + USDC + local routing**.
57
76
 
77
+ ### …and if you are a human, not an agent
78
+
79
+ Every "no X needed" above is a capability, not a restriction. **ClawRouter takes a credit card too.** Sign up at **[user.blockrun.ai](https://user.blockrun.ai)**, top up, mint an API key, and run `clawrouter login brk_live_…`. Same router, same <!-- br:models.chatVisible -->76<!-- /br:models.chatVisible --> models, same local routing β€” calls go to `api.blockrun.ai` on a bearer token and bill your account credit. No crypto, no gas, no seed phrase.
80
+
81
+ | You are | Pay with | Setup |
82
+ | ------------------- | --------------------------------------- | ---------------------------------------------------------------------------- |
83
+ | Just trying it | Nothing | Install and pin a free model |
84
+ | A person | **Credit card** β†’ account credit | [user.blockrun.ai](https://user.blockrun.ai) β†’ `clawrouter login brk_live_…` |
85
+ | An autonomous agent | **USDC** on Base or Solana, per request | Nothing β€” a wallet is generated on first run |
86
+
87
+ Full walkthrough: [Paying with a credit card](#paying-with-a-credit-card-api-key).
88
+
58
89
  ---
59
90
 
60
91
  ## How it compares
@@ -64,8 +95,8 @@ This is the stack that lets agents operate autonomously: **x402 + USDC + local r
64
95
  | **Models** | 200+ | 100+ | Smart routing | Gateway | **<!-- br:models.chatVisible -->76<!-- /br:models.chatVisible -->** |
65
96
  | **Free tier** | Rate-limited | BYO keys | No | No | **<!-- br:models.free -->7<!-- /br:models.free --> models, no signup** |
66
97
  | **Routing** | Manual selection | Manual selection | Smart (closed) | Observability | **Smart (open source)** |
67
- | **Auth** | Account + API key | Your API keys | Account + API key | Account + API key | **Wallet signature** |
68
- | **Payment** | Credit card | BYO keys | Credit card | $49-499/mo | **USDC per-request** |
98
+ | **Auth** | Account + API key | Your API keys | Account + API key | Account + API key | **Wallet signature _or_ API key** |
99
+ | **Payment** | Credit card | BYO keys | Credit card | $49-499/mo | **USDC per-request _or_ card credit** |
69
100
  | **Runs locally** | No | Yes | No | No | **Yes** |
70
101
  | **Open source** | No | Yes | No | Partial | **Yes** |
71
102
  | **Agent-ready** | No | No | No | No | **Yes** |
@@ -78,7 +109,20 @@ This is the stack that lets agents operate autonomously: **x402 + USDC + local r
78
109
 
79
110
  ## Quick Start
80
111
 
81
- > **No wallet? <!-- br:models.free -->7<!-- /br:models.free --> models work free out of the box.** Install, run, and pin `free/nemotron-3.5-lightning` (or any of the <!-- br:models.free -->7<!-- /br:models.free -->) β€” no crypto, no signup, no balance required. Add USDC later when you want paid models.
112
+ > **No wallet? <!-- br:models.free -->7<!-- /br:models.free --> models work free out of the box.** Install, run, and pin `free/nemotron-3.5-lightning` (or any of the <!-- br:models.free -->7<!-- /br:models.free -->) β€” no crypto, no signup, no balance required. Add a credit card or USDC later when you want paid models.
113
+
114
+ **Two ways to pay for the paid ones β€” pick one, the rest of ClawRouter is identical:**
115
+
116
+ | | Wallet (default) | API key |
117
+ | ----------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
118
+ | **Who it is for** | Autonomous agents, and anyone happy holding USDC | People who would rather pay with a card |
119
+ | **Setup** | Nothing β€” a wallet is generated on first run | Sign up at [user.blockrun.ai](https://user.blockrun.ai), top up, mint a key, `clawrouter login brk_live_…` |
120
+ | **Auth** | An x402 signature per request | `Authorization: Bearer brk_live_…` |
121
+ | **Gateway** | `blockrun.ai` (Base) / `sol.blockrun.ai` (Solana) | `api.blockrun.ai` |
122
+ | **Billing** | USDC leaves your wallet per call, non-custodial | Card-funded account credit, drawn down at exact usage |
123
+
124
+ ClawRouter prefers the API key whenever one is configured, so `clawrouter login`
125
+ is all it takes to switch and `clawrouter logout` is all it takes to switch back.
82
126
 
83
127
  ### Desktop control plane (macOS)
84
128
 
@@ -522,7 +566,10 @@ No Surf account, no API key β€” settles directly to Surf's Base treasury in USDC
522
566
 
523
567
  ## Payment
524
568
 
525
- No account. No API key. **Payment IS authentication** via [x402](https://x402.org).
569
+ Two rails. This section covers the wallet one; the card/API-key one is
570
+ [below](#paying-with-a-credit-card-api-key).
571
+
572
+ Here, no account and no API key are needed at all β€” **payment IS authentication**, via [x402](https://x402.org).
526
573
 
527
574
  ```
528
575
  Request β†’ 402 (price: $0.003) β†’ wallet signs USDC β†’ retry β†’ response
@@ -551,7 +598,93 @@ USDC stays in your wallet until spent β€” non-custodial. Price is visible in the
551
598
  - **Base (EVM):** Send USDC on Base to your EVM address
552
599
  - **Solana:** Send USDC on Solana to your Solana address
553
600
  - **Coinbase/CEX:** Withdraw USDC to either network
554
- - **Credit card:** Reach out to [@bc1max on Telegram](https://t.me/bc1max)
601
+ - **Credit card:** don't fund a wallet at all β€” use an API key instead (below)
602
+
603
+ ---
604
+
605
+ ## Paying with a credit card (API key)
606
+
607
+ Wallets are what let an _agent_ pay for itself. If you are a person and would
608
+ rather pay the way you pay for everything else, BlockRun issues API keys backed
609
+ by card-funded credit β€” and ClawRouter speaks that too.
610
+
611
+ **1. Sign up and get a key**
612
+
613
+ Go to **[user.blockrun.ai](https://user.blockrun.ai)**:
614
+
615
+ 1. Sign in.
616
+ 2. **Credits** β†’ top up with a credit card. The processing fee is charged at
617
+ purchase, not on inference: you pay it once on the top-up and every model
618
+ then bills at the published list price, with **no per-call minimum and no
619
+ per-call fee**.
620
+ 3. **API Keys** β†’ create a key. It is shown once and looks like
621
+ `brk_live_…` β€” copy it before you leave the page.
622
+
623
+ **2. Tell ClawRouter about it**
624
+
625
+ ```bash
626
+ clawrouter login brk_live_... # stores it in ~/.blockrun/.api-key (chmod 600)
627
+ clawrouter login # or run bare and paste at the prompt
628
+ ```
629
+
630
+ Or, for CI and containers where you would rather not write a file:
631
+
632
+ ```bash
633
+ export BLOCKRUN_API_KEY=brk_live_...
634
+ ```
635
+
636
+ Either way, restart the proxy. That is the whole change β€” routing, model names,
637
+ the free tier, `/model auto`, exclusions and the OpenAI-compatible surface all
638
+ behave exactly as before:
639
+
640
+ ```bash
641
+ npx @blockrun/clawrouter
642
+ # [ClawRouter] Using BlockRun API key brk_live_Ab3xQ9…f8c1 (from ~/.blockrun/.api-key)
643
+ # [ClawRouter] Billing: account credit β€” top up at https://user.blockrun.ai/dashboard/credits
644
+ ```
645
+
646
+ **3. Check it, and switch back whenever**
647
+
648
+ ```bash
649
+ clawrouter status # names the mode, the gateway, and the masked key
650
+ clawrouter doctor # verifies the key against the gateway (401 = revoked or mistyped)
651
+ clawrouter logout # delete the key and go back to paying from the wallet
652
+ ```
653
+
654
+ **Using it directly, without ClawRouter.** The same key works against
655
+ `api.blockrun.ai` from any OpenAI or Anthropic SDK β€” `Authorization: Bearer` for
656
+ OpenAI clients, `x-api-key` for Anthropic ones:
657
+
658
+ ```bash
659
+ curl https://api.blockrun.ai/v1/chat/completions \
660
+ -H "Authorization: Bearer brk_live_..." \
661
+ -H "Content-Type: application/json" \
662
+ -d '{"model": "anthropic/claude-sonnet-5", "messages": [{"role": "user", "content": "hello"}]}'
663
+ ```
664
+
665
+ Running it through ClawRouter is what adds the smart routing, the fallback
666
+ chains, the response cache and the local spend controls.
667
+
668
+ **What to know**
669
+
670
+ - **The key wins.** If a wallet and a key are both present, ClawRouter uses the
671
+ key. A machine with both means "bill my account", not "keep spending my USDC".
672
+ `clawrouter logout` (and unsetting `BLOCKRUN_API_KEY`) reverses it.
673
+ - **No wallet is created.** In API-key mode ClawRouter never generates, reads or
674
+ signs with a private key β€” `clawrouter doctor` will not mint one either.
675
+ - **Balance lives server-side.** There is no local balance to check: a call that
676
+ outruns your credit comes back as HTTP `402 insufficient_quota`, naming the
677
+ top-up page. Free models stay free and need no credit at all.
678
+ - **Chat today, media next.** `api.blockrun.ai` currently serves the chat and
679
+ text-completion endpoints (`/v1/chat/completions`, `/v1/messages`, `/v1/models`).
680
+ Image, video, audio and the partner APIs are still wallet-only; ClawRouter says
681
+ so explicitly instead of returning a bare 404, and they light up on the API-key
682
+ path as BlockRun publishes them β€” no ClawRouter release needed.
683
+ - **`maxCostPerRun` and `/exclude` still apply**, along with the router's own
684
+ budget filter β€” they live in the router, not the signer. **`clawrouter policy`
685
+ limits do not**: they are enforced in the x402 pre-sign hook, and nothing is
686
+ signed here. Your account balance is the cap instead, and ClawRouter warns at
687
+ startup if you have one of those limits configured.
555
688
 
556
689
  ---
557
690
 
@@ -576,13 +709,14 @@ USDC stays in your wallet until spent β€” non-custodial. Price is visible in the
576
709
 
577
710
  For basic usage, no configuration needed. For advanced options:
578
711
 
579
- | Variable | Default | Description |
580
- | --------------------------- | ------------------------------------- | ---------------------------------------------------------------- |
581
- | `BLOCKRUN_WALLET_KEY` | auto-generated | Your wallet private key |
582
- | `BLOCKRUN_PROXY_PORT` | `8402` | Local proxy port |
583
- | `CLAWROUTER_DISABLED` | `false` | Disable smart routing |
584
- | `CLAWROUTER_DEBUG_HEADERS` | `on` | Set to `off` to suppress `x-clawrouter-*` debug response headers |
585
- | `CLAWROUTER_SOLANA_RPC_URL` | `https://api.mainnet-beta.solana.com` | Solana RPC endpoint |
712
+ | Variable | Default | Description |
713
+ | --------------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
714
+ | `BLOCKRUN_API_KEY` | unset | BlockRun API key (`brk_live_…`). Set it and ClawRouter pays from account credit via `api.blockrun.ai` instead of the wallet |
715
+ | `BLOCKRUN_WALLET_KEY` | auto-generated | Your wallet private key |
716
+ | `BLOCKRUN_PROXY_PORT` | `8402` | Local proxy port |
717
+ | `CLAWROUTER_DISABLED` | `false` | Disable smart routing |
718
+ | `CLAWROUTER_DEBUG_HEADERS` | `on` | Set to `off` to suppress `x-clawrouter-*` debug response headers |
719
+ | `CLAWROUTER_SOLANA_RPC_URL` | `https://api.mainnet-beta.solana.com` | Solana RPC endpoint |
586
720
 
587
721
  **Full reference:** [docs/configuration.md](docs/configuration.md)
588
722
 
@@ -685,7 +819,7 @@ npm test
685
819
 
686
820
  **The LLM router built for autonomous agents**
687
821
 
688
- You're here. <!-- br:models.chatVisible -->76<!-- /br:models.chatVisible --> models, local smart routing, x402 USDC payments β€” the only stack that lets agents operate independently.
822
+ You're here. <!-- br:models.chatVisible -->76<!-- /br:models.chatVisible --> models, local smart routing, and two ways to pay β€” a credit-card-funded API key, or x402 USDC from a wallet, which is what lets an agent operate independently.
689
823
 
690
824
  `curl -fsSL https://blockrun.ai/ClawRouter-update | bash`
691
825
 
@@ -751,6 +885,10 @@ Python plugin that wraps the ClawRouter proxy for `hermes-agent`. Same <!-- br:m
751
885
 
752
886
  ## Frequently Asked Questions
753
887
 
888
+ ### What is BlockRun?
889
+
890
+ BlockRun lets agents pay for the outcome β€” every LLM, tool and data source, best value per dollar. One endpoint and one balance covering <!-- br:models.chatVisible -->76<!-- /br:models.chatVisible --> chat models plus image, video, music and speech generation, search, market data and multi-chain RPC, billed per call with USDC over [x402](https://x402.org) or a credit-card-funded API key β€” no seat, no subscription, no minimum. ClawRouter is the open-source local router agents use to reach it.
891
+
754
892
  ### What is ClawRouter?
755
893
 
756
894
  ClawRouter is an open-source (MIT licensed) smart LLM router built for autonomous AI agents. It analyzes each request across <!-- br:clawrouter.dimensions -->15<!-- /br:clawrouter.dimensions --> dimensions and routes to the cheapest capable model in under 1ms, entirely locally β€” no external API calls needed for routing decisions.
@@ -761,16 +899,25 @@ On the `auto` profile ClawRouter costs <!-- br:savings.autoVsBaselinePct -->84<!
761
899
 
762
900
  ### How does ClawRouter compare to OpenRouter?
763
901
 
764
- ClawRouter is open source and runs locally. It uses wallet-based authentication (no API keys) and USDC per-request payments (no credit cards or subscriptions). OpenRouter requires an account, API key, and credit card. ClawRouter also features smart routing β€” it automatically picks the best model for each request, while OpenRouter requires manual model selection.
902
+ ClawRouter is open source and runs locally. It supports wallet-based authentication with USDC per-request payments β€” which OpenRouter cannot do, and which is what lets an agent pay for itself with no account at all β€” _and_ the ordinary path of an API key funded by credit card at [user.blockrun.ai](https://user.blockrun.ai). OpenRouter only offers the second. ClawRouter also features smart routing β€” it automatically picks the best model for each request, while OpenRouter requires manual model selection.
765
903
 
766
904
  ### How does ClawRouter compare to LiteLLM?
767
905
 
768
- Both are open source and run locally. But ClawRouter adds smart routing (automatic model selection), wallet-based auth, and USDC payments. LiteLLM requires you to bring your own API keys and manually choose models.
906
+ Both are open source and run locally. But ClawRouter adds smart routing (automatic model selection) and its own billing β€” a credit-card-funded API key, or a wallet paying USDC per request. LiteLLM has no billing of its own: you bring your own provider API keys and manually choose models.
769
907
 
770
908
  ### What agents does ClawRouter work with?
771
909
 
772
910
  ClawRouter works with any tool that makes OpenAI-compatible API calls β€” point it at `http://localhost:8402`. This includes continue.dev, Cursor, VS Code extensions, ElizaOS, and custom agents. It also integrates as a plugin with [OpenClaw](https://openclaw.ai) (an AI coding agent), which enables additional features like slash commands and usage reports.
773
911
 
912
+ ### Do I need a crypto wallet to use ClawRouter?
913
+
914
+ No. A wallet is the default because it is what lets an _agent_ pay for itself,
915
+ but you can sign up at **[user.blockrun.ai](https://user.blockrun.ai)**, top up
916
+ with a credit card, mint an API key and run `clawrouter login brk_live_…`. Calls
917
+ then go to `api.blockrun.ai` on a bearer token and bill your account credit β€” no
918
+ crypto, no gas, no seed phrase. And the <!-- br:models.free -->7<!-- /br:models.free --> free models need neither: no
919
+ wallet, no key, no signup. See [Paying with a credit card](#paying-with-a-credit-card-api-key).
920
+
774
921
  ### Is ClawRouter free?
775
922
 
776
923
  ClawRouter itself is free and MIT licensed. You pay only for the LLM API calls routed through it β€” and several open-weight models (`nemotron-3.5-lightning`, `nemotron-3-nano-30b`, `laguna-xs-2.1`, `north-mini-code`, `nemotron-3-nano-omni-30b-a3b-reasoning`, `nemotron-3-ultra-550b`, `llama-3.2-11b-vision`) are completely free (text only). Use `/model free` to smart-route across them, or pick any by name.