# blockrunai/clawrouter

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/blockrunai-clawrouter).**

3,020 stars · 301 forks · TypeScript · mit

## Links

- GitHub: https://github.com/BlockRunAI/ClawRouter
- awesome-repositories: https://awesome-repositories.com/repository/blockrunai-clawrouter.md

## Topics

`ai` `ai-agents` `anthropic` `cost-optimization` `crypto` `deepseek` `gemini` `llm` `llm-router` `micropayments` `openai` `openclaw` `smart-routing` `usdc` `x402`

## Description

ClawRouter is an AI model router and API gateway designed to classify query complexity and assign prompts to the most efficient model tier. It operates as a multi-model AI proxy that orchestrates traffic between various large language models and AI media generators through a unified interface.

The project distinguishes itself by integrating a non-custodial micropayment processor using the x402 protocol. This allows for per-request API access and USDC settlement on Base and Solana chains, replacing static API keys with wallet-based authentication and real-time budget enforcement.

The system covers broad capability areas including automated model failover management, response caching for cost control, and multi-modal proxying for text, image, and video generation. It further integrates blockchain data services, enabling on-chain SQL querying, financial market data retrieval, and wallet intelligence analysis.

The project is implemented as a local AI proxy server that intercepts and routes standardized AI API requests to various backends.

## Tags

### Artificial Intelligence & ML

- [Model Routers](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/model-integration-serving/model-orchestration/model-routers.md) — Acts as a model router that dynamically assigns prompts to the most efficient model tier based on query complexity.
- [Agentic Task Detection](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-request-routing/agentic-task-detection.md) — Identifies multi-step or tool-using requests via a scoring pathway to trigger specialized model configurations. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/smart-llm-router-14-dimension-classifier.md))
- [Model Tier Selectors](https://awesome-repositories.com/f/artificial-intelligence-ml/decision-trees/minimax/model-tier-selectors.md) — Implements a logic for selecting model tiers based on query complexity to optimize the balance between cost and quality.
- [LLM Fallback Managers](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-fallback-managers.md) — Controls traffic by rerouting failed requests across a chain of alternative providers to ensure continuous availability.
- [LLM Gateways](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-gateways.md) — Provides a centralized gateway that aggregates multiple LLM providers into a single standardized API.
- [LLM Response Streaming](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-response-streaming.md) — Converts non-streaming JSON API responses into Server-Sent Events for token-by-token delivery. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/architecture.md))
- [Capability-Based Routing](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-evaluation-and-validation/model-capability-assessment/model-capability-queries/capability-based-routing.md) — Implements routing logic that selects AI models based on specific functional capabilities like vision processing. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/clawrouter-vs-openrouter-llm-routing-comparison.md))
- [Failover Mechanisms](https://awesome-repositories.com/f/artificial-intelligence-ml/model-provider-management/failover-mechanisms.md) — Implements automatic fallback chains to switch AI model providers when primary services experience outages.
- [Cost-Performance Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-selection-tools/cost-performance-optimizers.md) — Optimizes costs and performance by routing requests to the most efficient model tier based on complexity.
- [Model Fallbacks](https://awesome-repositories.com/f/artificial-intelligence-ml/model-task-retries/model-fallbacks.md) — Provides a prioritized chain of alternative models to maintain availability when primary providers return errors. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/architecture.md))
- [Multi-Model AI Orchestrators](https://awesome-repositories.com/f/artificial-intelligence-ml/multi-model-ai-orchestrators.md) — Operates as an orchestrator that connects diverse AI models and media generators via a unified local interface.
- [Prompt Complexity Classification](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-complexity-classification.md) — Classifies prompt complexity by analyzing reasoning, code, and technical requirements to assign a difficulty tier. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/smart-llm-router-14-dimension-classifier.md))
- [AI Image Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-image-generation.md) — Integrates AI models to produce visual assets from text prompts with configurable output sizes. ([source](https://github.com/BlockRunAI/ClawRouter#readme))
- [AI Video Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-video-generators.md) — Synthesizes short videos from text or image inputs and proxies the resulting media to local storage. ([source](https://github.com/BlockRunAI/ClawRouter#readme))
- [Dynamic Tier Escalation](https://awesome-repositories.com/f/artificial-intelligence-ml/decision-trees/minimax/model-tier-selectors/dynamic-tier-escalation.md) — Upgrades the model complexity tier automatically after detecting repeated identical requests to break agentic loops. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/CHANGELOG.md))
- [Image Editing](https://awesome-repositories.com/f/artificial-intelligence-ml/image-generation/image-editing.md) — Enables modification of existing images using text prompts and masks via generative AI instructions. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/image-generation.md))
- [Model Performance Evaluators](https://awesome-repositories.com/f/artificial-intelligence-ml/model-performance-evaluators.md) — Evaluates language models using latency and pricing metrics to optimize routing efficiency. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/benchmark-merged.json))
- [Provider Failover Handlers](https://awesome-repositories.com/f/artificial-intelligence-ml/sampling-strategies/sampling-provider-fallbacks/provider-failover-handlers.md) — Maps provider-specific errors to standardized categories to manage retries and provider failover. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/clawrouter-cuts-llm-api-costs-500x.md))
- [Web Search Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/web-search-integrations.md) — Connects the system to external search providers to enable augmented real-time web capabilities for models. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/configuration.md))

### Business & Productivity Software

- [Micropayment Protocols](https://awesome-repositories.com/f/business-productivity-software/micropayment-protocols.md) — Implements the x402 protocol for non-custodial USDC micropayments to settle per-request AI API fees.
- [Blockchain-Based Settlements](https://awesome-repositories.com/f/business-productivity-software/online-payment-processing/blockchain-based-settlements.md) — Settles API usage fees using USDC on Solana and Base chains with integrated wallet verification. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/CHANGELOG.md))
- [Non-Custodial Payment Flows](https://awesome-repositories.com/f/business-productivity-software/online-payment-processing/non-custodial-payment-flows.md) — Handles service authentication and payments via non-custodial USDC transactions on Base or Solana. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/README.md))
- [Micropayment Protocol Implementations](https://awesome-repositories.com/f/business-productivity-software/online-payment-processing/request-based-payment-gating/micropayment-protocol-implementations.md) — Implements the x402 protocol for executing per-request micropayments on blockchain networks. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/architecture.md))
- [AI Token Budget Controllers](https://awesome-repositories.com/f/business-productivity-software/financial-operational-management/billing-financial-systems/billing-and-usage/budget-cap-configurations/ai-token-budget-controllers.md) — Enforces strict spending limits and per-session cost ceilings to prevent billing overages on AI model requests. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/clawrouter-cuts-llm-api-costs-500x.md))
- [AI Agent Payment Frameworks](https://awesome-repositories.com/f/business-productivity-software/payment-integrations/agent-payment-facilitators/ai-agent-payment-frameworks.md) — Provides a unified system for managing model usage costs and micropayment settlement across multiple providers. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/package.json))
- [Prediction Markets](https://awesome-repositories.com/f/business-productivity-software/prediction-markets.md) — Fetches market rankings and trade volumes from prediction platforms via a unified interface. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/skills/surf/SKILL.md))
- [Real-Time Usage Tracking](https://awesome-repositories.com/f/business-productivity-software/usage-metering-billing/real-time-usage-tracking.md) — Tracks real-time consumption of billable units via response headers to enforce budget caps. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/clawrouter-vs-openrouter-llm-routing-comparison.md))

### Data & Databases

- [Response Caching](https://awesome-repositories.com/f/data-databases/response-caching.md) — Caches model responses locally to serve repeat requests instantly and reduce API costs. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/anthropic-cost-savings.md))
- [Blockchain Data Analytics](https://awesome-repositories.com/f/data-databases/blockchain-data-analytics.md) — Extracts and queries historical ledger records, market data, and token analytics via a unified routing layer. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/README.md))
- [Crypto Data Routing](https://awesome-repositories.com/f/data-databases/crypto-data-routing.md) — Forwards requests to a unified crypto data API covering exchange prices, market rankings, and project metrics. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/skills/surf/SKILL.md))
- [LLM Token Compression](https://awesome-repositories.com/f/data-databases/data-compression-algorithms/visual-token-compression/llm-token-compression.md) — Reduces billed token counts by deduplicating messages and minifying data before sending requests. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/anthropic-cost-savings.md))
- [Request Body Hashing](https://awesome-repositories.com/f/data-databases/in-memory-caches/request-scoped-caching/request-body-hashing.md) — Identifies duplicate requests by hashing payloads to serve cached responses and prevent redundant billing.
- [On-Chain SQL Execution](https://awesome-repositories.com/f/data-databases/sql-query-execution/on-chain-sql-execution.md) — Executes structured SQL queries against on-chain data and retrieves schema definitions for introspection. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/skills/surf/SKILL.md))
- [Wallet Intelligence Analysis](https://awesome-repositories.com/f/data-databases/wallet-intelligence-analysis.md) — Retrieves detailed wallet profiles, net worth, and transaction history for specific blockchain addresses. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/skills/surf/SKILL.md))

### Networking & Communication

- [AI Provider Proxies](https://awesome-repositories.com/f/networking-communication/api-proxies/ai-provider-proxies.md) — Implements a local proxy server designed to route and manage traffic to multiple large language model providers. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/9-free-ai-models-zero-cost-blockrun.md))
- [Server-Sent Events](https://awesome-repositories.com/f/networking-communication/server-sent-events.md) — Converts standard JSON API responses into an incremental event stream for real-time content delivery.
- [Multi-Modal Provider Proxies](https://awesome-repositories.com/f/networking-communication/api-proxies/ai-provider-proxies/multi-modal-provider-proxies.md) — Routes requests for text, image, and video generation through a single interface to unify different provider APIs.
- [Cost Estimation & Buffering](https://awesome-repositories.com/f/networking-communication/payment-requirement-notifications/payment-requirement-validators/cost-estimation-buffering.md) — Estimates request costs and signs payment buffers in advance to bypass the payment-required round trip. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/architecture.md))

### Security & Cryptography

- [Crypto Wallet Content Payments](https://awesome-repositories.com/f/security-cryptography/private-wallet-management/cryptocurrency-wallets/crypto-wallet-content-payments.md) — Signs payment payloads locally using wallet keys to comply with micropayment protocols for model access. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/openclaw.security.json))
- [x402 Micropayments](https://awesome-repositories.com/f/security-cryptography/private-wallet-management/cryptocurrency-wallets/crypto-wallet-content-payments/x402-micropayments.md) — Uses the x402 protocol and non-custodial wallets to handle per-request USDC micropayments for AI API usage.
- [On-Chain Payment Verification](https://awesome-repositories.com/f/security-cryptography/token-validation-services/on-chain-payment-verification.md) — Monitors USDC balances across EVM and Solana networks to verify liquidity before executing model calls.
- [Wallet Signature Authentication](https://awesome-repositories.com/f/security-cryptography/wallet-signature-authentication.md) — Uses cryptographic wallet signatures to authorize per-request API access and replace static API keys. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/clawrouter-vs-openrouter-llm-routing-comparison.md))
- [Payment-Gated Access](https://awesome-repositories.com/f/security-cryptography/wallet-signature-authentication/payment-gated-access.md) — Restricts API access and processes micropayments using wallet authentication and the x402 standard. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/CLAUDE.md))

### Software Engineering & Architecture

- [Task Complexity Analyzers](https://awesome-repositories.com/f/software-engineering-architecture/task-complexity-analyzers.md) — Analyzes prompt reasoning and technical requirements across weighted dimensions to assign complexity tiers.
- [Complexity-Based Routers](https://awesome-repositories.com/f/software-engineering-architecture/task-complexity-analyzers/complexity-based-routers.md) — Automatically assigns the most cost-effective model tier by analyzing query complexity through weighted scoring. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/routing-profiles.md))

### Web Development

- [API Request Deduplication](https://awesome-repositories.com/f/web-development/api-request-deduplication.md) — Prevents duplicate billing by hashing request bodies to identify and replay cached responses. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/architecture.md))
- [Complexity Tier Mappings](https://awesome-repositories.com/f/web-development/routing-strategies/ai-model/complexity-tier-mappings.md) — Maps prompt complexity tiers to specific models based on cost, performance, and quality optimization goals. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/smart-llm-router-14-dimension-classifier.md))
- [Model Tool Calls](https://awesome-repositories.com/f/web-development/third-party-api-integrations/model-tool-calls.md) — Converts textual or XML tool invocations into structured tool calls for downstream API execution. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/CHANGELOG.md))

### DevOps & Infrastructure

- [Rate Limiters](https://awesome-repositories.com/f/devops-infrastructure/rate-limiters.md) — Tracks rate limits on a per-model basis to prevent provider failures from blocking fallback chains. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/clawrouter-cuts-llm-api-costs-500x.md))

### System Administration & Monitoring

- [Routing Diagnostics](https://awesome-repositories.com/f/system-administration-monitoring/diagnostic-troubleshooting/routing-diagnostics.md) — Provides technical diagnostics on model selection, session state, and routing scores to troubleshoot failures. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/CHANGELOG.md))
- [AI Reasoning Inspections](https://awesome-repositories.com/f/system-administration-monitoring/session-tracking/session-health-monitors/ai-session-observability/ai-reasoning-inspections.md) — Attaches debug headers to responses to expose the chosen model, confidence scores, and routing reasoning. ([source](https://github.com/BlockRunAI/ClawRouter/blob/main/docs/configuration.md))
