Open source · MIT · v1.2

Stop paying frontier prices for “thanks!”

ClawRoute is a local proxy that classifies every LLM request in under 5ms and sends it to the cheapest model that can handle it. If that model fails, it escalates before your app ever sees a bad answer.

$ npm install -g clawroute
$ export OPENAI_API_KEY=sk-... # or a .env file
$ clawroute start
✅ ClawRoute is running on http://127.0.0.1:18790
60–90%lower API spend
<5mslocal classification
4providers + OpenRouter
0prompts leave your machine

/how it works

Most of your traffic doesn't need your best model.

Heartbeats, acknowledgements and quick questions make up a big share of an agent's calls. ClawRoute sits between your client and your providers and decides, per request, what each one actually needs.

Your client

OpenClaw, Cursor, your own app: anything that speaks the OpenAI API.

ClawRoute · 127.0.0.1:18790

  1. Classify the request locally
  2. Route to the cheapest capable model
  3. Validate the answer; escalate if it fails
  4. Log the cost and savings to SQLite

Providers

OpenAI, Anthropic, Google, DeepSeek, or anything on OpenRouter, using your own keys.

/tiers

Five tiers, decided by rules you can read.

No model call to decide which model to call. The classifier is plain heuristics, so it's fast, free and predictable. Every default below can be changed in config.

TierWhat lands hereDefault model
heartbeatPings and liveness checks: “hi”, “are you there?”gemini-2.5-flash-lite
simple“thanks”, “ok”, emoji replies, short questionsdeepseek-chat
moderateGeneral conversation (the default)gemini-2.5-flash
complexAnalysis, tool use, deep threads, short code requestsclaude-sonnet-4-6
frontierCode blocks, forced tool calls, very long context, imagesclaude-opus-4-6

/safety

Built so it can't break your agent.

A router that saves money but corrupts a tool call isn't worth running. These rules hold on every request.

Streams are never interrupted

Once tokens start flowing to your client, ClawRoute is committed. No restarts, no doubled output.

Tool calls are never retried

A response containing tool calls is returned as-is, so an action can't run twice.

Errors fall through

If ClawRoute itself hits an error, the request goes to the model you originally asked for.

One-call kill switch

POST /api/disable or CLAWROUTE_ENABLED=false stops all routing immediately.

Local and private

Binds to 127.0.0.1. Classification makes no network calls. Content isn't logged unless you turn it on.

No telemetry

No analytics, no phoning home. Your keys go straight to your providers.

/use it

Point your client at it. That's the integration.

ClawRoute speaks the OpenAI API, including /v1/models, so changing one base URL is enough.

// any OpenAI SDK client
const client = new OpenAI({
  baseURL: "http://127.0.0.1:18790/v1",
  apiKey: process.env.OPENAI_API_KEY,
});

# OpenClaw: ~/.openclaw/openclaw.json
providers.openai.baseUrl = "http://127.0.0.1:18790/v1"

Then watch what it saves:

clawroute statsToday's requests, savings and tier mix (--week for 7 days) clawroute logRecent routing decisions and why each was made clawroute dry-runClassify and log without rerouting: see the savings before you commit clawroute liveLeave dry-run and start routing clawroute disablePass everything through to the original model

/compared

ClawRoute vs OpenRouter

They solve different problems. OpenRouter gives you one key for hundreds of models. ClawRoute picks the right model for you, on your machine.

ClawRouteOpenRouter
runsLocally, on your machineTheir cloud
promptsNever leave your machinePass through their servers
overheadNone; you pay providers directlyPlatform fee per request
model choiceAutomatic, per requestYou choose
setupLocal install + your own keysOne key, nothing to install

/limits

What it doesn't do.