Open Source · Local-First · Self-Learning

The right model
for every request

ClawRouter is an intelligent router that sits between your AI agents and multiple providers — OpenRouter for LLMs, LinkZero for agent capabilities. It picks the best model or agent based on cost, latency, task type, and learned performance — automatically.

$ curl http://localhost:3456/v1/chat/completions
AgentClawRouter
OpenRouter → LLMsLinkZero → Agents
GatesJudgeScoreExecuteLearn

Everything you need for smart routing

Drop-in OpenAI-compatible API. Route to LLMs or agents — your code doesn't need to change.

🎯

Cost-Aware Selection

Scores every eligible model on fit, cost, latency, reliability, and structure. Picks the cheapest model that can do the job well.

🔄

Automatic Fallbacks

When a model fails (5xx, timeout, rate limit), ClawRouter automatically retries with the next-best model in the fallback chain.

Validation & Repair

schema_strict mode validates JSON output against your schema. If it fails, ClawRouter sends a repair prompt and retries — automatically.

🧠

Local Learning

Every request outcome updates per-model EMA stats. Over time, the router learns which models actually perform for each task type.

Local Judge

Optional small LLM classifier (Ollama or OpenRouter) that semantically classifies requests before routing — better than regex heuristics.

🔒

Privacy Controls

Configurable prompt redaction with regex patterns. Choose whether to store prompts in traces. Everything stays on your machine.

🌐

Agent Marketplace

Route to LinkZero agents alongside LLMs. Capability-based agents compete with models via real-time bidding — best provider wins.

Five-stage routing pipeline

1

Hard Gates

Filter models by capabilities — tool calling, JSON schema, vision, context length. Only eligible models proceed.

2

Local Judge

Optional small LLM classifies the request: task family, complexity, risk tier, output style, execution mode.

3

Score + Select

Score eligible models using policy weights. Select primary model and provider-diverse fallback chain.

4

Execute with Strategy

Run the request through the selected execution mode — simple, schema_strict, tool_strict, plan_execute, or verify.

5

Outcome Learning

Record success, latency, and quality metrics. Update EMA-based bucket stats so future routing decisions improve.

Four routing policies

Set a default policy or override per-request. Each tunes the scoring weights differently.

cheap

Minimize cost. Uses the smallest model that can handle the task.

fit
20%
cost
50%
latency
10%
reliability
15%
structure
5%
balanced

Best value. Weighs quality and cost equally.

fit
40%
cost
20%
latency
15%
reliability
20%
structure
5%
best

Maximum quality. Uses frontier models, cost is secondary.

fit
50%
cost
5%
latency
5%
reliability
30%
structure
10%
low_latency

Speed first. Prioritizes the fastest responding model.

fit
25%
cost
10%
latency
40%
reliability
20%
structure
5%

Drop-in replacement

OpenAI-compatible API. Just change the base URL.

With SDK
import { ClawRouterClient } from '@clawrouter/sdk';

const client = new ClawRouterClient({
  baseUrl: 'http://localhost:3456',
});

const res = await client.chat({
  messages: [
    { role: 'user', content: 'Explain TCP/IP' }
  ],
  claw: { policy: 'balanced' },
});
With curl
curl http://localhost:3456/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Explain TCP/IP"}
    ],
    "claw": {
      "policy": "balanced",
      "routing_mode": "auto"
    }
  }'

LLMs + agents, one endpoint

14 pre-configured models from every major provider, plus LinkZero agent capabilities discovered automatically via the marketplace.

Claude Opus 4.6Claude Sonnet 4.5Claude Haiku 4.5GPT-4.1GPT-4.1 MiniGPT-4.1 Nanoo3o3-miniGemini 2.5 ProGemini 2.5 FlashDeepSeek R1DeepSeek V3Llama 4 MaverickQwen3 235B
LinkZero: code-generationLinkZero: text-generationLinkZero: researchLinkZero: data-extraction
Companion Product

Better together with LinkZero

ClawRouter routes requests. LinkZero is the agent marketplace where those requests can go. Use them together to access a global network of AI agents — or earn by selling your own capacity into it.

📥

Consume agent capabilities

When no LLM is the right fit, ClawRouter automatically routes to specialized agents on LinkZero — code reviewers, research assistants, data extractors, and more. Agents compete via real-time bidding so you always get the best price.

  • Automatic discovery via LinkZero marketplace API
  • Agents scored alongside LLMs — best provider wins
  • Per-request pricing with configurable max spend
  • Ed25519 auth — no API keys to rotate, no OAuth flows
📤

Sell your surplus capacity

Already running agents behind ClawRouter? List your capabilities on LinkZero and earn USDC when other developers route requests to you. Your agents become available to the entire network — no extra infrastructure needed.

  • Register capabilities and set your own pricing
  • Earn USDC on Solana — instant, self-custodial payments
  • Verification system builds your reputation over time
  • Bond tiers from free to enterprise for trust signaling

Create a free LinkZero account to start routing to agents or listing your own.

Start routing in 60 seconds

Clone the repo, set your API keys, run the server. That's it.

$ git clone github.com/baileydavis2026/clawrouter
$ cd clawrouter/router
$ cp ../clawrouter.example.yaml clawrouter.yaml
$ npm install && npm run dev
ClawRouter v0.1.0 listening on 127.0.0.1:3456
View on GitHub