Home
Softono
b

blockrunai

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
2

Software by blockrunai

ClawRouter
Open Source

ClawRouter

<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><br><br> <em>6 models free, no crypto required. No signup. No API key. No credit card.</em></p> <br> <img src="https://img.shields.io/badge/🆓_6_Free_Models-success?style=for-the-badge" alt="6 free models">&nbsp; <img src="https://img.shields.io/badge/🤖_Agent--Native-black?style=for-the-badge" alt="Agent native">&nbsp; <img src="https://img.shields.io/badge/🔑_Zero_API_Keys-blue?style=for-the-badge" alt="No API keys">&nbsp; <img src="https://img.shields.io/badge/⚡_Local_Routing-yellow?style=for-the-badge" alt="Local routing">&nbsp; <img src="https://img.shields.io/badge/💰_x402_USDC-purple?style=for-the-badge" alt="x402 USDC">&nbsp; <img src="https://img.shields.io/badge/🔓_Open_Source-green?style=for-the-badge" alt="Open source"> [![npm version](https://img.shields.io/npm/v/@blockrun/clawrouter.svg?style=flat-square&color=cb3837)](https://npmjs.com/package/@blockrun/clawrouter) [![npm downloads](https://img.shields.io/npm/dm/@blockrun/clawrouter.svg?style=flat-square&color=blue)](https://npmjs.com/package/@blockrun/clawrouter) [![GitHub stars](https://img.shields.io/github/stars/BlockRunAI/ClawRouter?style=flat-square&label=GitHub%20stars)](https://github.com/BlockRunAI/ClawRouter) [![CI](https://img.shields.io/github/actions/workflow/status/BlockRunAI/ClawRouter/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/BlockRunAI/ClawRouter/actions) [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-3178c6?style=flat-square&logo=typescript&logoColor=white)](https://typescriptlang.org) [![License: MIT](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE) [![USDC Hackathon Winner](https://img.shields.io/badge/🏆_USDC_Hackathon-Agentic_Commerce_Winner-gold?style=flat-square)](https://x.com/USDC/status/2021625822294216977) [![x402 Protocol](https://img.shields.io/badge/x402-Micropayments-purple?style=flat-square)](https://x402.org) [![Base Network](https://img.shields.io/badge/Base-USDC-0052FF?style=flat-square&logo=coinbase&logoColor=white)](https://base.org) [![Solana](https://img.shields.io/badge/Solana-USDC-9945FF?style=flat-square&logo=solana&logoColor=white)](https://solana.com) [![OpenClaw Plugin](https://img.shields.io/badge/OpenClaw-Plugin-orange?style=flat-square)](https://openclaw.ai) [![Telegram](https://img.shields.io/badge/Telegram-Community-26A5E4?style=flat-square&logo=telegram)](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: - **Starts at $0** — 6 NVIDIA models are free forever (incl. 1M-context DeepSeek V4 Flash + a vision-capable Nemotron Omni) - **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+** | | **Free tier** | Rate-limited | BYO keys | No | No | **6 models, no signup** | | **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 > **No wallet? 6 models work free out of the box.** Install, run, and pin `nvidia/gpt-oss-120b` (or any of the 6) — no crypto, no signup, no balance required. Add USDC later when you want paid models. ### Option A — OpenClaw Agent [OpenClaw](https://openclaw.ai) is an AI coding agent. If you're using it, ClawRouter installs as a plugin. **Two paths:** **A1. Recommended — one-shot install script:** ```bash curl -fsSL https://blockrun.ai/ClawRouter-update | bash openclaw gateway restart ``` This handles everything: registration, models config, auth profile, wallet setup. Smart routing (`blockrun/auto`) is now your default model. **A2. If you prefer pure npm:** ```bash npm install -g @blockrun/clawrouter clawrouter setup # finishes OpenClaw integration — REQUIRED openclaw gateway restart ``` > ⚠️ **Skipping `clawrouter setup` will leave you broken.** Bare `npm install -g` only puts the package on disk; it does NOT register the plugin with OpenClaw, sync the models allowlist, or write the auth profile. Symptom: `/models` in your bot shows only ~7 entries (OpenClaw's hardcoded defaults) instead of the full ~38 BlockRun models. Run `clawrouter setup` to repair, or use path A1 to begin with. ### Option B — Standalone (continue.dev, Cursor, VS Code, any OpenAI-compatible client) > **Using Claude Code?** Check out [BRCC](https://blockrun.ai/brcc.md) — it's purpose-built for Claude Code with the same smart routing and x402 payments. > > **Using NousResearch Hermes?** See [ClawRouter-Hermes](https://github.com/BlockRunAI/ClawRouter-Hermes) — a Python plugin that wires Hermes into the ClawRouter proxy. Same wallet, same 55+ models, same x402 USDC settlement on Base & Solana. No OpenClaw required. ClawRouter runs as a local proxy on port 8402. **1. Start the proxy** ```bash npx @blockrun/clawrouter ``` **2. Fund your wallet** — optional, skip for free tier Your wallet address is printed on first run. For paid models, send a few USDC on Base or Solana — $5 covers thousands of requests. To stay at $0, pin any of the 6 free models (e.g. `nvidia/gpt-oss-120b`) or use `/model free` inside OpenClaw. **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.8`, `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 free` | Free NVIDIA models | **100%** | $0 balance, learning | | `/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.6 ($0.95/$4.00) | | MEDIUM | gemini-3.1-flash-lite ($0.25/$1.50) | kimi-k2.6 ($0.95/$4.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.8 ($5/$25) | | REASONING | grok-4-1-fast-reasoning ($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 `/cr-imagegen`: ``` /cr-imagegen a dog dancing on the beach /cr-imagegen --model dall-e-3 a futuristic city at sunset /cr-imagegen --model banana-pro --size 2048x2048 mountain landscape ``` > The slash command is `/cr-imagegen` to avoid colliding with Telegram channel commands. Typing `/imagegen` in chat still works for backward compatibility. | 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 | | `xai/grok-imagine-image` | xAI Grok Imagine | $0.02/image | 1024x1024 | | `xai/grok-imagine-image-pro` | xAI Grok Imagine Pro | $0.07/image | 1024x1024 | | `zai/cogview-4` | Zhipu CogView-4 | $0.015/image | 1440x1440 | ## Video Generation Generate short AI videos directly from chat with `/videogen`: ``` /videogen a red apple slowly spinning /videogen --model seedance-2-fast --duration=5 a cat waving /videogen --model grok-video a neon city at night ``` Or drive it over HTTP — ClawRouter proxies the BlockRun gateway, handles x402 payment, and downloads the returned MP4 to local disk, rewriting `url` to `http://localhost:8402/videos/<file>.mp4` so the asset survives past the upstream's temporary bucket. ```bash curl -X POST http://localhost:8402/v1/videos/generations \ -H "Content-Type: application/json" \ -d '{"model":"bytedance/seedance-2.0-fast","prompt":"a red apple slowly spinning","duration_seconds":5}' ``` | Model | Provider | 5s text-to-video | 5s image-to-video | Duration | | ----------------------------- | ------------------- | ---------------- | ----------------- | --------------------- | | `bytedance/seedance-1.5-pro` | ByteDance Seedance | ~$0.46 | ~$0.46 (flat) | 5s default, up to 10s | | `bytedance/seedance-2.0-fast` | ByteDance Seedance | ~$1.19 | ~$1.19 (flat) | 5s default, up to 10s | | `bytedance/seedance-2.0` | ByteDance Seedance | ~$1.49 | ~$1.49 (flat) | 5s default, up to 10s | | `azure/sora-2` | OpenAI Sora (Azure) | ~$0.42 (4s) | ~$0.42 (4s, flat) | 4s default; 4/8/12s | | `xai/grok-imagine-video` | xAI Grok Imagine | ~$0.42 (8s) | n/a | 8s default | Seedance is **token-priced upstream** at ~20,256 tokens/sec — the blockrun videos route now defaults Seedance to `resolution=720p` with `generate_audio=true` for text-to-video (2× the per-second token count of the older 480p baseline; audio is included in that rate). The quote is `duration × tokens/sec × $/1M tokens × 1.05 margin`. Image-to-video is priced the same as text-to-video (the earlier ~40% i2v discount was removed upstream on 2026-06-01; only video-to-video remains cheaper). Sora 2 is flat-priced at $0.10/sec for both t2v and i2v — note it rejects human faces in reference images (use Seedance + RealFace for real people). Calls block for 30–120s while the upstream polls the job. Seedance 2.0 Fast typically returns in 60–80s; 2.0 Pro trades latency for quality. ### BytePlus RealFace (Seedance 2.0 only) For real-person character consistency across frames, pass `real_face_asset_id` (format `ta_xxxxxxxx`) on **2.0 Fast** or **2.0 Pro**. Asset IDs come from token360's Asset UI after H5 face verification — see blockrun's [/docs/video/real-person-ip](https://blockrun.ai/docs/video/real-person-ip) for the enrollment walkthrough. Cannot be combined with `image_url` (both seed the first frame — pick one). Pricing is unchanged. ```bash curl -X POST http://localhost:8402/v1/videos/generations \ -H "Content-Type: application/json" \ -d '{"model":"bytedance/seedance-2.0","prompt":"the person walks through a forest","real_face_asset_id":"ta_abc123def","duration_seconds":5}' ``` ## 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 | | ----------------- | -------- | ------------------------------------- | | `--image <path>` | Yes | Local image file path (supports `~/`) | | `--mask <path>` | No | Mask image (white = area to edit) | | `--model <model>` | No | Model to use (default: `gpt-image-1`) | | `--size <WxH>` | No | Output size (default: `1024x1024`) | **API endpoint:** `POST http://localhost:8402/v1/images/image2image` — see [full docs](docs/image-generation.md#post-v1imagesimage2image). ## Phone & Voice Calls Verify phone numbers and place AI-powered outbound voice calls directly from chat. Phone intelligence runs on Twilio; voice calls use Bland.ai. Payment is automatic via x402 from the wallet. ``` /cr-call +14155552671 "Hi, this is calling to confirm tomorrow's 3pm meeting" /cr-call +14155552671 "Order a large pepperoni for delivery" --voice josh --max-duration 10 ``` Calls are **fire-and-forget**: the request returns a `call_id` and `poll_url` immediately. The call itself runs in the cloud for up to 30 minutes. Poll `GET /v1/voice/call/{call_id}` (or `clawrouter share`/transcripts dashboard) to retrieve the transcript and recording when status is `completed`. | Operation | Provider | Price | | --------------------------------- | -------- | ----------------------- | | Phone lookup (carrier, line type) | Twilio | $0.01 | | Fraud check (SIM-swap, fwd) | Twilio | $0.05 | | Buy phone number (30-day lease) | Twilio | $5.00 | | Renew lease (+30 days) | Twilio | $5.00 | | List wallet's owned numbers | Twilio | $0.001 | | Release a number | Twilio | free | | **AI voice call (≤30 min)** | Bland.ai | **$0.54 flat per call** | | Poll call status / transcript | Bland.ai | free | **CLI for wallet-owned numbers:** ```bash clawrouter phone numbers list # See active numbers + expiry clawrouter phone numbers buy US --area-code 415 # Provision a SF number clawrouter phone numbers renew +14155551234 # Extend 30 days clawrouter phone numbers release +14155551234 # Release clawrouter phone lookup +14155552671 # Carrier + line type clawrouter phone fraud +14155552671 # SIM-swap + fwd signals ``` **HTTP API:** ```bash # Place a call curl -X POST http://localhost:8402/v1/voice/call \ -H "Content-Type: application/json" \ -d '{"to":"+14155552671","task":"Confirm the 3pm Thursday meeting.","max_duration":5}' # → { "call_id": "call_abc123", "poll_url": "/v1/voice/call/call_abc123", "status": "queued" } # Poll for transcript curl http://localhost:8402/v1/voice/call/call_abc123 ``` LLM agents discover all eight operations as `blockrun_phone_*` / `blockrun_voice_*` tools (see `/partners`). > ⚠️ `blockrun_voice_call` and `/cr-call` place a **real** outbound phone call. Server enforces an emergency-number blocklist; choose `--from` from wallet-owned numbers via `phone numbers list`. --- ## Crypto Data (Surf) Surf is BlockRun's unified crypto data API — **84 endpoints across 13 domains**: CEX/DEX markets, on-chain SQL over 80+ ClickHouse tables (Ethereum, Base, Arbitrum, BSC, TRON, HyperEVM, Tempo), 100M+ labeled wallets, prediction markets (Polymarket + Kalshi), social/CT mindshare, news, project/DeFi metrics, token analytics, unified search, VC fund intelligence. The killer feature is ad-hoc `POST /surf/onchain/sql` — agents query the warehouse directly without running an indexer. ClawRouter ships Surf as a **skill, not as typed wrappers**. The proxy whitelists `/v1/surf/*` so any call through the local proxy is paid x402 from the same wallet; the agent reads `skills/surf/SKILL.md` for the endpoint catalog and crafts the HTTP call. No `blockrun_surf_*` tool definitions to maintain; a new Surf endpoint requires zero ClawRouter release. | Tier | Cost | Examples | | ---- | ---------: | ------------------------------------------------------------- | | 1 | **$0.001** | prices, rankings, lists, news | | 2 | **$0.005** | orderbooks, candles, search, wallet details, social mindshare | | 3 | **$0.020** | on-chain SQL / query / schema, chat completions | **Usage (HTTP):** ```bash # Aggregated BTC spot price (Tier 1, $0.001) curl 'http://localhost:8402/v1/surf/market/price?symbol=BTC' # Bulk wallet labels over 100M+ labeled wallets (Tier 2, $0.005) curl 'http://localhost:8402/v1/surf/wallet/labels/batch?addresses=0xabc,0xdef,0x123' # Ad-hoc on-chain SQL (Tier 3, $0.020) curl -X POST 'http://localhost:8402/v1/surf/onchain/sql' \ -H 'content-type: application/json' \ -d '{"sql":"SELECT count() FROM ethereum.transactions WHERE block_timestamp >= now() - INTERVAL 1 HOUR"}' ``` No Surf account, no API key — settles directly to Surf's Base treasury in USDC via the same wallet as LLM calls. Full endpoint reference: [`skills/surf/SKILL.md`](skills/surf/SKILL.md). Upstream marketplace: <https://blockrun.ai/marketplace/surf>. --- ## Models & Pricing 55+ models across 9 providers, one wallet. **Starting at $0.0002/request.** > **💡 "Cost per request"** = estimated cost for a typical chat message (~500 input + 500 output tokens). ### Budget Models (under $0.001/request) | Model | Input $/M | Output $/M | ~$/request | Context | Features | | --------------------------------------------- | --------: | ---------: | ---------: | ------- | -------------------------------------------- | | nvidia/gpt-oss-120b | **FREE** | **FREE** | **$0** | 128K | default free model | | nvidia/gpt-oss-20b | **FREE** | **FREE** | **$0** | 128K | smaller, faster | | nvidia/deepseek-v4-flash | **FREE** | **FREE** | **$0** | 1M | reasoning, ~5x faster than v4-pro | | nvidia/qwen3-coder-480b | **FREE** | **FREE** | **$0** | 131K | coding | | nvidia/llama-4-maverick | **FREE** | **FREE** | **$0** | 131K | reasoning | | nvidia/nemotron-3-nano-omni-30b-a3b-reasoning | **FREE** | **FREE** | **$0** | 256K | reasoning, **vision** (text+img+video+audio) | | openai/gpt-5-nano | $0.05 | $0.40 | $0.0002 | 128K | tools | | openai/gpt-4.1-nano | $0.10 | $0.40 | $0.0003 | 128K | tools | | google/gemini-2.5-flash-lite | $0.10 | $0.40 | $0.0003 | 1M | tools | | openai/gpt-4o-mini | $0.15 | $0.60 | $0.0004 | 128K | tools | | xai/grok-4-fast | $0.20 | $0.50 | $0.0004 | 131K | tools | | xai/grok-4-fast-reasoning | $0.20 | $0.50 | $0.0004 | 131K | reasoning, tools | | xai/grok-4-1-fast | $0.20 | $0.50 | $0.0004 | 131K | tools | | xai/grok-4-1-fast-reasoning | $0.20 | $0.50 | $0.0004 | 131K | reasoning, tools | | xai/grok-4-0709 | $0.20 | $1.50 | $0.0009 | 131K | reasoning, tools | | openai/gpt-5-mini | $0.25 | $2.00 | $0.0011 | 200K | tools | | deepseek/deepseek-chat | $0.20 | $0.40 | $0.0003 | 1M | tools (V4 Flash chat) | | deepseek/deepseek-reasoner | $0.20 | $0.40 | $0.0003 | 1M | reasoning, tools (V4 Flash thinking) | | deepseek/deepseek-v4-pro | $0.435 | $0.87 | $0.0007 | 1M | reasoning, agentic, tools (V4 flagship) | | zai/glm-5 | $0.60 | $1.92 | $0.0013 | 200K | tools | | zai/glm-5-turbo | $1.20 | $4.00 | $0.0026 | 200K | tools | | xai/grok-3-mini | $0.30 | $0.50 | $0.0004 | 131K | tools | | minimax/minimax-m3 | $0.30 | $1.20 | $0.0008 | 1M | reasoning, agentic, tools | | minimax/minimax-m2.7 | $0.30 | $1.20 | $0.0008 | 205K | reasoning, agentic, tools | | minimax/minimax-m2.5 | $0.30 | $1.20 | $0.0008 | 205K | reasoning, agentic, tools | | google/gemini-2.5-flash | $0.30 | $2.50 | $0.0014 | 1M | vision, tools | | openai/gpt-4.1-mini | $0.40 | $1.60 | $0.0010 | 128K | tools | | google/gemini-3.5-flash | $0.50 | $3.00 | $0.0018 | 1M | reasoning, vision, tools (thinking built-in) | | google/gemini-3-flash-preview | $0.50 | $3.00 | $0.0018 | 1M | vision | | moonshot/kimi-k2.5 | $0.60 | $3.00 | $0.0018 | 262K | reasoning, vision, agentic, tools | | moonshot/kimi-k2.6 | $0.95 | $4.00 | $0.0025 | 262K | reasoning, vision, agentic, tools | ### Mid-Range Models ($0.001–$0.01/request) | Model | Input $/M | Output $/M | ~$/request | Context | Features | | --------------------------- | --------: | ---------: | ---------: | ------- | ----------------------------------------- | | anthropic/claude-haiku-4.5 | $1.00 | $5.00 | $0.0030 | 200K | vision, agentic, tools | | openai/o1-mini | $1.10 | $4.40 | $0.0028 | 128K | reasoning, tools | | openai/o3-mini | $1.10 | $4.40 | $0.0028 | 128K | reasoning, tools | | openai/o4-mini | $1.10 | $4.40 | $0.0028 | 128K | reasoning, tools | | google/gemini-2.5-pro | $1.25 | $10.00 | $0.0056 | 1M | reasoning, vision, tools | | zai/glm-5.1 | $1.40 | $4.40 | $0.0029 | 200K | reasoning, tools (promo ended 2026-06-05) | | xai/grok-4.3 | $1.50 | $4.00 | $0.0028 | 1M | reasoning, vision, agentic, tools | | xai/grok-build-0.1 | $1.50 | $3.00 | $0.0023 | 256K | agentic coding, tools | | openai/gpt-5.2 | $1.75 | $14.00 | $0.0079 | 400K | reasoning, vision, agentic, tools | | openai/gpt-5.3 | $1.75 | $14.00 | $0.0079 | 128K | reasoning, vision, agentic, tools | | openai/gpt-5.3-codex | $1.75 | $14.00 | $0.0079 | 400K | agentic, tools | | openai/gpt-4.1 | $2.00 | $8.00 | $0.0050 | 128K | vision, tools | | openai/o3 | $2.00 | $8.00 | $0.0050 | 200K | reasoning, tools | | google/gemini-3-pro-preview | $2.00 | $12.00 | $0.0070 | 1M | reasoning, vision, tools | | google/gemini-3.1-pro | $2.00 | $12.00 | $0.0070 | 1M | reasoning, vision, tools | | xai/grok-2-vision | $2.00 | $10.00 | $0.0060 | 131K | vision, tools | | openai/gpt-4o | $2.50 | $10.00 | $0.0063 | 128K | vision, agentic, tools | | openai/gpt-5.4 | $2.50 | $15.00 | $0.0088 | 400K | reasoning, vision, agentic, tools | ### Premium Models ($0.01+/request) | Model | Input $/M | Output $/M | ~$/request | Context | Features | | --------------------------- | --------: | ---------: | ---------: | ------- | --------------------------------- | | anthropic/claude-sonnet-4.6 | $3.00 | $15.00 | $0.0090 | 200K | reasoning, vision, agentic, tools | | xai/grok-3 | $3.00 | $15.00 | $0.0090 | 131K | reasoning, tools | | anthropic/claude-opus-4.8 | $5.00 | $25.00 | $0.0150 | 1M | reasoning, vision, agentic, tools | | openai/gpt-5.5 | $5.00 | $30.00 | $0.0175 | 1M | reasoning, vision, agentic, tools | | openai/o1 | $15.00 | $60.00 | $0.0375 | 200K | reasoning, tools | | openai/gpt-5.2-pro | $21.00 | $168.00 | $0.0945 | 400K | reasoning, tools | | openai/gpt-5.4-pro | $30.00 | $180.00 | $0.1050 | 400K | reasoning, tools | > **Free tier:** several NVIDIA-hosted models cost nothing — `/model free` smart-routes across them, or pick one directly (e.g., `/model nemotron-omni` for vision, `/model deepseek-v4-flash` for 1M context, `/model qwen-coder` for coding, `/model maverick`). > **Best value:** `gpt-5-nano` and `gemini-2.5-flash-lite` deliver strong results at ~$0.0003/request. --- ## Payment No account. No API key. **Payment IS authentication** via [x402](https://x402.org). ``` Request → 402 (price: $0.003) → wallet signs USDC → retry → response ``` USDC stays in your wallet until spent — non-custodial. Price is visible in the 402 header before signing. **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. ```bash /wallet # Check balance and address (both chains) /wallet export # Export mnemonic + keys for backup /wallet recover # Restore wallet from mnemonic on a new machine /wallet solana # Switch to Solana USDC payments /wallet base # Switch back to Base (EVM) USDC payments /chain solana # Alias for /wallet solana /stats # View usage and savings /stats clear # Reset usage statistics /exclude # Show excluded models /exclude add <model> # Block a model from routing (aliases work: "grok-4", "free") /exclude remove <model> # Unblock a model /exclude clear # Remove all exclusions ``` **Fund your wallet:** - **Base (EVM):** Send USDC on Base to your EVM address - **Solana:** Send USDC on Solana to your Solana address - **Coinbase/CEX:** Withdraw USDC to either network - **Credit card:** Reach out to [@bc1max on Telegram](https://t.me/bc1max) --- ## Screenshots <table> <tr> <td width="50%" align="center"> <strong>Smart Routing in Action</strong><br><br> <img src="docs/clawrouter-savings.png" alt="ClawRouter savings" width="400"> </td> <td width="50%" align="center"> <strong>Telegram Integration</strong><br><br> <img src="assets/telegram-demo.png" alt="Telegram demo" width="400"> </td> </tr> </table> --- ## Configuration For basic usage, no configuration needed. For advanced options: | Variable | Default | Description | | --------------------------- | ------------------------------------- | ----------------------- | | `BLOCKRUN_WALLET_KEY` | auto-generated | Your wallet private key | | `BLOCKRUN_PROXY_PORT` | `8402` | Local proxy port | | `CLAWROUTER_DISABLED` | `false` | Disable smart routing | | `CLAWROUTER_SOLANA_RPC_URL` | `https://api.mainnet-beta.solana.com` | Solana RPC endpoint | **Full reference:** [docs/configuration.md](docs/configuration.md) ### Model Exclusion Block specific models from being routed to. Useful if a model doesn't follow your agent instructions or you want to control costs. ```bash /exclude add nvidia/gpt-oss-120b # Block the default free model /exclude add grok-4 # Aliases work — blocks all grok-4 variants /exclude add gpt-5.4 # Skip expensive models /exclude # Show current exclusions /exclude remove grok-4 # Unblock a model /exclude clear # Remove all exclusions ``` Exclusions persist across restarts (`~/.openclaw/blockrun/exclude-models.json`). If all models in a tier are excluded, the safety net ignores the filter so routing never breaks. --- ## Troubleshooting **When things go wrong, run the doctor:** ```bash npx @blockrun/clawrouter doctor ``` This collects diagnostics and sends them to Claude Sonnet for AI-powered analysis: ``` 🩺 BlockRun Doctor v0.12.24 System ✓ OS: darwin arm64 ✓ Node: v22.14.0 Wallet ✓ Address: 0x1234...abcd ✓ Balance: $12.50 Network ✓ BlockRun API: reachable (142ms) ✗ Local proxy: not running on :8402 📤 Sending to Claude Sonnet 4.6 (~$0.003)... 🤖 AI Analysis: The local proxy isn't running. Run `openclaw gateway restart` to fix. ``` **Use Opus for complex issues:** ```bash npx @blockrun/clawrouter doctor opus ``` **Ask a specific question:** ```bash npx @blockrun/clawrouter doctor "why is my request failing?" npx @blockrun/clawrouter doctor opus "深度分析我的配置" ``` **Cost:** Sonnet ~$0.003 (default) | Opus ~$0.01 --- ## Development ```bash git clone https://github.com/BlockRunAI/ClawRouter.git cd ClawRouter npm install npm run build npm test ``` --- ## Support | Channel | Link | | --------------------- | ------------------------------------------------------------------ | | 📅 Schedule Demo | [calendly.com/vickyfu9/30min](https://calendly.com/vickyfu9/30min) | | 💬 Community Telegram | [t.me/blockrunAI](https://t.me/blockrunAI) | | 🐦 X / Twitter | [x.com/blockrunai](https://x.com/blockrunai) | | 📱 Founder Telegram | [@bc1max](https://t.me/bc1max) | | ✉️ Email | [email protected] | --- ## From the BlockRun Ecosystem <table> <tr> <td width="50%"> ### ⚡ ClawRouter **The LLM router built for autonomous agents** You're here. 55+ models, local smart routing, x402 USDC payments — the only stack that lets agents operate independently. `curl -fsSL https://blockrun.ai/ClawRouter-update | bash` </td> <td width="50%"> ### 🤖 [BRCC](https://blockrun.ai/brcc.md) **BlockRun for Claude Code** Run Claude Code with 50+ models, no rate limits, no Anthropic account, no phone verification. Pay per request with USDC — your wallet is your identity. `curl -fsSL https://blockrun.ai/brcc-install | bash` </td> </tr> <tr> <td width="50%"> ### 🐍 [ClawRouter-Hermes](https://github.com/BlockRunAI/ClawRouter-Hermes) **ClawRouter for NousResearch Hermes** Python plugin that wraps the ClawRouter proxy for `hermes-agent`. Same 55+ models, same x402 USDC payments on Base & Solana, native Hermes ergonomics. `pip install hermes-plugin-clawrouter` </td> <td width="50%"> <!-- next ecosystem entry goes here --> </td> </tr> </table> --- ## More Resources | Resource | Description | | ------------------------------------------------------ | ------------------------ | | [Documentation](https://blockrun.ai/docs) | Full docs | | [Model Pricing](https://blockrun.ai/models) | All models & prices | | [Image Generation & Editing](docs/image-generation.md) | API examples, 5 models | | [Routing Profiles](docs/routing-profiles.md) | ECO/AUTO/PREMIUM details | | [Architecture](docs/architecture.md) | Technical deep dive | | [Configuration](docs/configuration.md) | Environment variables | | [Troubleshooting](docs/troubleshooting.md) | Common issues | ### Blog | Article | Topic | | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | | [9 Free AI Models, Zero Cost](docs/9-free-ai-models-zero-cost-blockrun.md) | How BlockRun gives developers top-tier LLMs for nothing | | [ClawRouter Cuts LLM API Costs 500×](docs/clawrouter-cuts-llm-api-costs-500x.md) | Deep dive into cost savings | | [ClawRouter vs OpenRouter](docs/clawrouter-vs-openrouter-llm-routing-comparison.md) | Head-to-head comparison | | [Smart LLM Router: 14-Dimension Classifier](docs/smart-llm-router-14-dimension-classifier.md) | How the routing engine works | | [LLM Router Benchmark: 46 Models, Sub-1ms](docs/llm-router-benchmark-46-models-sub-1ms-routing.md) | Performance benchmarks | | [Anthropic Cost Savings](docs/anthropic-cost-savings.md) | Reducing Claude API spend | --- ## Frequently Asked Questions ### What is ClawRouter? ClawRouter is an open-source (MIT licensed) smart LLM router built for autonomous AI agents. It analyzes each request across 15 dimensions and routes to the cheapest capable model in under 1ms, entirely locally — no external API calls needed for routing decisions. ### How much can ClawRouter save on LLM costs? ClawRouter's blended average cost is $2.05 per million tokens compared to $25/M for Claude Opus, representing 92% savings. Actual savings depend on your workload — simple queries are routed to free models ($0/request), while complex tasks get premium models. ### How does ClawRouter compare to OpenRouter? 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. ### How does ClawRouter compare to LiteLLM? 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. ### What agents does ClawRouter work with? 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. ### Is ClawRouter free? ClawRouter itself is free and MIT licensed. You pay only for the LLM API calls routed through it — and several NVIDIA-hosted models (`gpt-oss-120b`, `gpt-oss-20b`, `deepseek-v4-flash`, `qwen3-coder-480b`, `llama-4-maverick`, `nemotron-3-nano-omni-30b-a3b-reasoning`) are completely free. Use `/model free` to smart-route across them, or pick any by name. --- <div align="center"> **MIT License** · [BlockRun](https://blockrun.ai) — Agent-native AI infrastructure ⭐ If ClawRouter powers your agents, consider starring the repo! </div>

AI Agents Crypto & Blockchain
6.6K Github Stars
Franklin
Open Source

Franklin

<div align="center"> <br> <img src="assets/terminal-banner.png" alt="Franklin Agent terminal" width="680"> <br><br> <h1>Franklin Agent</h1> <h3>The AI agent with a wallet.</h3> <p> Other agents write code. Franklin Agent writes code <em>and spends money</em> to get things done.<br> One wallet. Every model. Every paid API. Pay only for outcomes — not subscriptions. </p> <p> <a href="https://npmjs.com/package/@blockrun/franklin"><img src="https://img.shields.io/npm/v/@blockrun/franklin.svg?style=flat-square&color=FFD700&label=npm" alt="npm"></a> <a href="https://npmjs.com/package/@blockrun/franklin"><img src="https://img.shields.io/npm/dm/@blockrun/franklin.svg?style=flat-square&color=10B981&label=downloads" alt="downloads"></a> <a href="https://github.com/BlockRunAI/Franklin/stargazers"><img src="https://img.shields.io/github/stars/BlockRunAI/Franklin?style=flat-square&color=FFD700&label=stars" alt="stars"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache_2.0-blue?style=flat-square" alt="license"></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript"></a> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node-%E2%89%A520-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node"></a> <a href="https://x402.org"><img src="https://img.shields.io/badge/x402-native-10B981?style=flat-square" alt="x402"></a> <a href="https://t.me/blockrunAI"><img src="https://img.shields.io/badge/chat-telegram-26A5E4?style=flat-square&logo=telegram&logoColor=white" alt="telegram"></a> </p> <p> <a href="#quick-start">Quick&nbsp;start</a> · <a href="#yopo">YOPO</a> · <a href="#a-new-category">Category</a> · <a href="#what-franklin-can-execute">What&nbsp;it&nbsp;does</a> · <a href="#smart-router">Smart&nbsp;Router</a> · <a href="#the-comparison">Comparison</a> · <a href="#how-it-works">Architecture</a> · <a href="#community">Community</a> </p> </div> --- ## The pitch in one paragraph Most coding agents write code. Franklin Agent writes code **and spends money to get the job done**. It holds a USDC wallet, picks the best model per task from 55+ providers, purchases trading data, generates images, pays for web search — all autonomously. You state an outcome and set a budget. Franklin Agent decides what to call, what to pay for, and when to stop. Every paid action routes through the [x402](https://x402.org) micropayment protocol and settles against your own wallet. No subscriptions. No API keys. No account. The wallet is the identity. Built by the [BlockRun](https://blockrun.ai) team. Apache-2.0. TypeScript. Ships as one npm package. > **YOPO — You Only Pay Outcome** > > Not a subscription (pay for access). Not a generic pay-per-call (pay for trying). > You pay only for the work Franklin Agent delivers. Provider cost + 5%, settled per action > in USDC. No monthly fees. No rate limits. No overdraft. --- ## Quick start ```bash # 1. Install npm install -g @blockrun/franklin # 2. Run (free — uses NVIDIA Nemotron & Qwen3 Coder out of the box) franklin # 3. (optional) Fund a wallet to unlock Sonnet, Opus, GPT, Gemini, Grok, + paid APIs franklin setup base # or: franklin setup solana franklin balance # show address + USDC balance ``` That's it. Zero signup, zero credit card, zero phone verification. Send **$5 of USDC** to the wallet and you've unlocked every frontier model and every paid tool in the BlockRun gateway. ### Prefer a GUI? Try Franklin for VS Code [![Franklin for VS Code — Beta is here](assets/franklin-vscode-banner.png)](https://marketplace.visualstudio.com/items?itemName=blockrun.franklin-vscode) The same agent ships as a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=blockrun.franklin-vscode) — chat panel, model picker, wallet balance, image / video generation, inline diff cards — all driven by the wallet you already funded for the CLI. ``` VS Code → Extensions (Cmd+Shift+X / Ctrl+Shift+X) → search "Franklin" → Install → click the Franklin icon in the Activity Bar ``` Free models work immediately. Paid models, image gen, and video gen activate the moment your wallet has USDC. The CLI and the extension share the same `~/.blockrun/` config and session history, so jumping between terminal and VS Code is seamless. --- ## YOPO **You Only Pay Outcome.** This is Franklin Agent's pricing model, and it is the opposite of almost every other AI product you use. | | You pay for... | Result | | ----------------------- | -------------------------------------------- | ------------------------------------ | | AI subscription | Access. Paid whether you use it or not. | $20–200/month, rate-limited. | | Pay-per-call (OpenAI API, etc.) | Every attempt — even failed ones. | Hidden cost from retries, dead ends. | | **Franklin Agent (YOPO)** | **The outcome.** Each signed micropayment. | **Provider cost + 5%. No more.** | Three consequences fall out of this: 1. **No subscriptions.** Use Franklin for $0.50 one week and $50 the next — you pay for compute actually consumed, nothing more. 2. **No rate limits.** Subscriptions throttle you when you need AI most. YOPO has no artificial caps — if you have USDC, you have access. 3. **No overdraft.** The wallet balance IS the hard limit. When it's empty, Franklin stops. No surprise bills, no 3 a.m. rate-limit walls. Concretely — $1 in USDC gets you roughly: - ~400K GPT-4o input tokens - ~7M DeepSeek tokens - ~13M Gemini Flash tokens - ~20 DALL-E 3 images - ~40 Exa neural web searches - Unlimited agent-tested NVIDIA free tier (Qwen3 Coder + Llama 4 Maverick, no wallet needed) --- ## A new category > **Economic Agent** > > Software that can hold a wallet, price its own actions, spend toward an outcome, and stop at a hard budget cap. Most AI products fit into one of three buckets: they answer questions, write code, or automate a fixed workflow. None of them can spend money. Franklin can. It combines **purchasing power** (it pays for models, tools, and APIs), **budget awareness** (cost is part of the loop, not an afterthought), **cross-vertical execution** (code, trading, research, marketing, ops), and **hard stopping conditions** (wallet balance is a real constraint, not a suggestion). That is why Franklin is an economic agent, not just a task agent. --- ## What Franklin can execute Franklin is **chat-first**. You do not wire a DAG, configure six API keys, or commit to one model vendor. You state an outcome. Franklin decides what to read, search, fetch, call, and pay for. ### 📈 Trading signals ```text > what's BTC looking like today? ✓ TradingSignal BTC ## BTC Signal Report Price: $71,056 USD (+2.3% 24h) Market Cap: $1.42T 24h Volume: $29.6B ### Technical Indicators (30d) - RSI(14): 53.2 — neutral - MACD: 339.21 / Signal: 280.45 — bullish crossover - Bollinger: within band (upper $73,773 / lower $64,545) - Volatility: 35.3% annualized — medium > if I enter at 65000 with $1000, where should my stop be? Based on ATR(14) and support at $63,500: Entry: $65,000 · Stop: $63,200 (−2.8%) · Risk: $27.69 Risk/reward to $70K target: 1:2.8 ✓ ``` Live data from CoinGecko. RSI, MACD, Bollinger, and volatility computed locally. No API key needed. ### 🎨 Image generation ```text > generate a logo for my AI startup — minimalist, dark background ✓ ImageGen "minimalist AI startup logo, dark background..." Saved: generated-logo-1713052800.png (1024x1024) ``` Generates images via DALL-E / GPT Image directly from the CLI. Paid from your wallet — no OpenAI API key needed. ### 📱 Remote control via Telegram Run `franklin telegram` on an always-on machine (set `TELEGRAM_BOT_TOKEN` + `TELEGRAM_OWNER_ID`) and drive Franklin from your phone. Owner-locked, session-resumable across restarts, slash commands (`/new`, `/balance`, `/status`). Trading, content, dev work — all reachable from a Telegram chat. ### 🔎 Research, code, anything with a budget ```text > compare the top 5 AI agent pricing models, summarize the patterns, and save a note for me ✓ WebSearch ai agent pricing models ✓ WebFetch 5 articles ✓ Write notes/agent-pricing.md Summary: - Most agents hide pricing behind monthly seats - Usage-based products win with power users and teams - Wallet-based billing is still basically empty whitespace ``` ```text > refactor src/auth.ts to use the new jwt helper, then run the tests ✓ Read src/auth.ts $0.002 ✓ Read src/lib/jwt.ts $0.001 ✓ Edit src/auth.ts (-24 +31 lines) $0.008 ✓ Bash npm test $0.000 › 142 passing · 0 failing · 2.4s Done in 18s · $0.011 ``` Code is still first-class. It is just **one workload**, not the category. Every tool call is itemized. Every token is priced. When the wallet hits zero, Franklin stops. No overdraft, no surprise bill, no rate-limit wall at 3 a.m. — this is YOPO in practice. --- ## Smart Router **55+ models. One decision. Zero guesswork.** You don't pick models. Franklin picks for you. The Smart Router classifies every request — coding, trading, reasoning, research — and selects the model with the best quality-to-cost ratio. Trained on **2M+ real requests** from the BlockRun gateway, continuously updated. ```text > refactor this auth module to use JWT CODING kimi-k2.5 · 12.4K in / 2.1K out · $0.0023 saved 84% > what's the BTC outlook for the week? TRADING grok-4-1-fast-reasoning · 8.2K in / 1.8K out · $0.0008 saved 95% > prove that this algorithm is O(n log n) REASONING claude-sonnet-4.6 · 15.1K in / 3.4K out · $0.0312 ``` Every response shows which model was chosen, why, and how much you saved vs. always using the most expensive option. **Four profiles:** | Profile | Strategy | Use case | |---------|----------|----------| | `auto` | Best quality-to-cost ratio | Default — smart spend | | `eco` | Cheapest model with decent quality | Budget-conscious | | `premium` | Highest quality regardless of cost | Mission-critical | | `free` | Free NVIDIA models only | Zero wallet balance | **Per-session breakdown** — run `/cost` to see exactly where your USDC went: ```text Session Cost: $0.0847 (23 requests) gemini-2.5-flash $0.0012 14 req CODING kimi-k2.5 $0.0423 6 req CODING claude-sonnet-4.6 $0.0412 3 req REASONING ``` The router also learns from **your** usage. If you keep retrying a model for coding tasks, Franklin adapts and picks a better one next time. Your router gets smarter the more you use it. --- ## Why Franklin <table> <tr> <td width="33%" valign="top"> ### 💳 &nbsp;AI is utility, not SaaS You don't subscribe to electricity, you pay for what you use. Franklin brings the same model to AI. YOPO settlement means Franklin never bills you for access, only for outcomes. No monthly fees, no rate limits, no overdraft. </td> <td width="33%" valign="top"> ### 🧠 &nbsp;Multi-model is the future No single model is best at everything. Sonnet writes better code, Gemini handles longer context, DeepSeek costs 20x less for simple tasks. The Smart Router routes every request to the optimal model in <1ms — up to 89% savings vs. always using Opus. </td> <td width="33%" valign="top"> ### 🔐 &nbsp;Wallet is identity No email. No phone. No KYC. Your Base or Solana address is your account — portable, permissionless, global. API keys require US banking and account approval. A wallet requires only USDC. </td> </tr> </table> --- ## The comparison | | Coding agents | Editor IDEs | Chatbots | **Franklin** | | -------------------------------------- | ---------------- | ---------------- | ---------------- | ------------------------------- | | Writes code | ✅ | ✅ | ⚠️ | ✅ | | **Spends money for you** | ❌ | ❌ | ❌ | ✅ **USDC wallet, x402** | | **Buys data + APIs + images + search** | ❌ | ❌ | ❌ | ✅ **55+ APIs, one wallet** | | Picks best model per task | ❌ single-vendor | ❌ plan-tied | ❌ | ✅ **Smart Router, 55+ models** | | Pricing model | Subscription | Subscription | Subscription | **YOPO** — per outcome, USDC | | Monthly fee | $20–$200 | $20–$40 | $20+ | **$0** | | Rate-limited | Yes | Yes | Yes | No — limited only by wallet | | Works when provider goes down | ❌ | ❌ | ❌ | ✅ **routes to another** | | Identity | Vendor account | Vendor account | Account / email | ✅ **wallet, no signup** | | Start free, no KYC | ❌ | ❌ | ❌ | ✅ | | Source | Closed | Closed | Closed | **Apache 2.0, local-first** | **Franklin is the economic agent category in one sentence:** software with a wallet that can spend toward a result. --- ## Features <table> <tr> <td width="50%" valign="top"> **💼 Wallet-native economic execution** Franklin can decide what is worth paying for, route the call, sign the micropayment, and keep going until the goal is done or the budget is exhausted. **📈 Trading signals** Ask "what's BTC looking like?" — Franklin fetches live price data, computes RSI/MACD/Bollinger/volatility, and synthesizes a signal. **🎨 AI image generation** Ask "generate a logo" — Franklin calls DALL-E / GPT Image, saves the result locally, paid from your wallet. **🧠 55+ models via one wallet** Anthropic, OpenAI, Google, xAI, DeepSeek, GLM, Kimi, Minimax, NVIDIA free tier. One wallet, one interface, automatic fallback. **💳 x402 micropayments (YOPO)** HTTP 402 native. Every paid action is a signed USDC micropayment via EIP-712 — non-custodial, your keys never leave your machine. YOPO: you pay only for outcomes. **🧠 Learned model router** Trained on 2M+ real requests. Classifies your task and picks the best model from 55+ LLMs. Four profiles (auto/eco/premium/free). Adapts to your usage over time. </td> <td width="50%" valign="top"> **🛠 16 built-in tools** Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, ImageGen, VideoGen, MemoryRecall, AskUser, SubAgent, TradingSignal, TradingMarket, TradingPortfolio, TradingOpenPosition, TradingClosePosition, TradingHistory. **💾 Persistent sessions** Every turn is streamed to disk with metadata. Resume any session by ID. Survives crashes, reboots, and compaction. **🔍 Full-text session search** `franklin search "payment loop"` from the CLI, or `/session-search "payment loop"` in chat. **📊 Cost insights** `franklin insights` shows spend breakdowns, trends, and projections. Never wonder where the USDC went. **⚡ Anthropic prompt caching** Multi-turn Sonnet/Opus sessions use ephemeral cache breakpoints to reduce input spend on long conversations. **🔌 Plugin SDK + MCP** Core is workflow-agnostic. Add new verticals without touching the loop. Discover external tools automatically through MCP. </td> </tr> </table> --- ## Slash commands | Command | What it does | | -------------------------------- | ---------------------------------------------------- | | `/model [name]` | Interactive model picker, or switch directly | | `/plan` / `/execute` | Read-only planning mode / execution mode | | `/ultrathink <q>` | Deep reasoning mode for hard problems | | `/compact` | Structured context compression | | `/search <q>` | Search the codebase | | `/session-search <q>` | Search past sessions | | `/history` / `/resume [id]` | Inspect or restore conversation state | | `/commit` / `/push` / `/pr` | Git workflow helpers | | `/review` / `/fix` / `/test` | One-shot code review, bugfix, or test runs | | `/cost` / `/wallet` | Session cost, wallet address, and balance | | `/insights [--days N]` | Rich usage analytics | | `/help` | Full command list | --- ## How it works ```text ┌──────────────────────────────────────────────────────────────┐ │ Franklin Runtime │ │ Intent → Smart Router → Tool Use → Spend Control → Result │ ├──────────────────────────────────────────────────────────────┤ │ Learned Router │ │ 2M+ requests · 55+ models · category detection · Elo scores │ ├──────────────────────────────────────────────────────────────┤ │ Agent Loop │ │ 16 tools · Sessions · Compaction · Pricing · Plugin SDK │ ├──────────────────────────────────────────────────────────────┤ │ BlockRun Gateway │ │ 55+ LLMs · CoinGecko · Search · Image APIs · paid services │ ├──────────────────────────────────────────────────────────────┤ │ x402 Micropayment Protocol │ │ HTTP 402 · USDC on Base & Solana · signed payment payloads │ └──────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────┐ │ Your wallet │ │ (you own) │ └─────────────┘ ``` The loop is simple: 1. You state an outcome. 2. Franklin chooses what to read, call, and pay for. 3. The payment settles against your wallet. 4. Franklin reports the result and the spend. That economic loop is the product. --- ## Project layout ```text src/ ├── index.ts CLI entry (franklin) ├── banner.ts Ben Franklin portrait + FRANKLIN gradient text ├── agent/ Agent loop, LLM client, compaction, commands ├── tools/ 20+ built-in tools (Read/Write/Edit/Bash/Glob/Grep/ │ WebFetch/WebSearch/Task/ImageGen/VideoGen/ │ MemoryRecall/AskUser/SubAgent/Trading*/Content*) ├── trading/ Market data (CoinGecko) + technical indicators ├── content/ Content library with budget-bound media generation ├── brain/ Cross-session entity knowledge graph ├── channel/ Non-CLI ingress drivers (Telegram today) ├── events/ Internal event bus ├── plugin-sdk/ Public plugin contract (Workflow/Plugin/Channel) ├── plugins/ Plugin registry + runner (plugin-agnostic) ├── session/ Persistent sessions + search + channel tags ├── stats/ Usage tracking + insights engine ├── ui/ Ink-based terminal UI ├── proxy/ Payment proxy for external tools ├── router/ Learned model router (55+ models, Elo scoring) ├── wallet/ Wallet management (Base + Solana) ├── mcp/ MCP server auto-discovery └── commands/ CLI subcommands ``` --- ## Free tier, for real Start with **zero dollars**. Franklin defaults to free NVIDIA models that need no wallet funding. ```bash franklin --model free ``` When you fund the wallet, Franklin gets more purchasing power: Sonnet, Opus, GPT, Gemini, Grok, and paid tools like Exa, DALL-E, and CoinGecko Pro. --- ## Remote control via Telegram Drive Franklin from anywhere with a bot token: ```bash export TELEGRAM_BOT_TOKEN=<from @BotFather> export TELEGRAM_OWNER_ID=<your numeric Telegram user id> franklin telegram # start the bot (owner-locked) ``` Session state resumes across process restarts (tagged by owner id). Slash commands `/new`, `/balance`, `/status`, `/help` handled locally by the bot layer; everything else forwards to the agent. Progressive streaming flushes partial answers at paragraph boundaries so long replies don't wait for turn-end. Same wallet. Same tools. From your phone. --- ## Documentation - [Plugin SDK guide](docs/plugin-sdk.md) — build your own workflow vertical - [Changelog](CHANGELOG.md) — every release explained - [Roadmap](docs/ROADMAP.md) — what's coming next - [Proxy mode](docs/) — use Franklin as a payment proxy for Anthropic-compatible CLI agents --- ## Community - [Telegram](https://t.me/blockrunAI) — realtime help, bug reports, feature requests - [@BlockRunAI](https://x.com/BlockRunAI) — release notes, demos - [Issues](https://github.com/BlockRunAI/Franklin/issues) — bugs and feature requests --- ## Contributors External contributors whose work has shipped into Franklin: - [**@KillerQueen-Z**](https://github.com/KillerQueen-Z) — typed Phone & Voice tools (#58), permissions classifier + internal VoiceStatus polling (#59), inline-paste threshold (#60), voicemail controls (#61), PredictionMarket / Predexon v2 schema realignment + agent-loop retry guard (#62) - [**@BeneficialVast1048**](https://github.com/BeneficialVast1048) — VoiceCall `interruption_threshold` + `model` controls (#66) - [**@TateLyman**](https://github.com/TateLyman) — test path-with-spaces fix (#57) PRs welcome — see the Development section below for the local loop. --- ## Development ```bash git clone https://github.com/BlockRunAI/Franklin.git cd franklin npm install npm run build npm test # deterministic local tests — no API calls npm run test:e2e # live e2e tests — free smoke works unfunded; paid tools need network + funded wallet npm run test:free-models # live matrix across current free NVIDIA models node dist/index.js --help ``` For the recommended live validation order and failure triage, see [docs/live-e2e-checklist.md](docs/live-e2e-checklist.md). **Contributing:** open an issue first to discuss meaningful changes. PRs welcome on bugs, docs, new models in pricing, and new tools. --- ## License Apache-2.0. See [LICENSE](LICENSE). --- <div align="center"> **The AI agent with a wallet.**<br> <sub>YOPO — You Only Pay Outcome. Your wallet. Your budget. Your results.</sub> <br> <sub>From the team at <a href="https://blockrun.ai">BlockRun</a>.</sub> </div>

AI Agents Crypto & Blockchain
628 Github Stars