← Back to PRs

#8562: feat(extensions): add BlockRun provider — 30+ models, smart routing, x402 payments

by 1bcMax open 2026-02-04 05:12 View on GitHub →
stale size: S
## Summary Adds **BlockRun** as a bundled provider extension. BlockRun gives OpenClaw access to 30+ AI models across OpenAI, Anthropic, Google, DeepSeek, and xAI — all through one wallet with x402 USDC micropayments. No API key, no account needed. ### Smart Routing When set to `blockrun/auto`, ClawRouter classifies each request and picks the cheapest model that can handle it: ``` "What is 2+2?" → Gemini Flash $0.60/M saved 99% "Summarize this article" → DeepSeek Chat $0.42/M saved 99% "Build a React component" → Claude Opus $75.00/M best quality "Prove this theorem" → o3 $8.00/M saved 89% ``` Weighted average: **$16.17/M — 78% cheaper than Claude Opus**. Hybrid rules-first classifier with 14 weighted scoring dimensions handles ~80% of requests in <1ms via sigmoid confidence calibration. LLM fallback for ambiguous cases costs ~$0.00003. ### How It Works - Thin wrapper in `extensions/blockrun/` that re-exports `@blockrun/clawrouter` - All logic lives in the [standalone npm package](https://www.npmjs.com/package/@blockrun/clawrouter) - Local proxy between OpenClaw and BlockRun API handles x402 payment signing - Routing is fully client-side, open source, and inspectable ### Why This Matters This is the first **x402-native** provider for OpenClaw. Instead of API keys and prepaid balances: - Agent generates a wallet → receives funds → pays per request - USDC stays in the user's wallet until spent (non-custodial) - Wallet signature is cryptographic proof (no shared secrets) ### Files Added ``` extensions/blockrun/ ├── package.json # Depends on @blockrun/clawrouter ├── openclaw.plugin.json # Provider manifest (id: clawrouter) ├── index.ts # Re-exports from @blockrun/clawrouter └── README.md # Setup instructions ``` ### Links - GitHub: https://github.com/BlockRunAI/ClawRouter - npm: https://www.npmjs.com/package/@blockrun/clawrouter - x402 protocol: https://x402.org ### Test ```bash openclaw plugin install @blockrun/clawrouter export BLOCKRUN_WALLET_KEY=0x... openclaw config set model blockrun/auto ``` All 19 e2e tests pass including live API calls with real USDC payments.

Most Similar PRs