ROUTING ACTIVE
LEARNING
OPENCLAW INTEGRATION
100% LOCALZERO CLOUD

Cut Agent
Costs by
50%

Intelligent model routing. Haiku for simple tasks. Opus when it matters. All decisions local. All data private.

$npx clawhub@latest install RelayPlane/relayplane
LIVE ROUTINGACTIVE
task_typecode_review
complexitylow
routed_toclaude-3-5-haiku
cost_saved92%
OPUS COST$15.00/1M
HAIKU COST$0.25/1M
// WHY THIS EXISTS

OpenClaw is Exploding

100K+ GitHub stars. The AI coding agent that's changing how developers work. One session can make hundreds of API calls — and token costs spiral fast.

A typical debugging session? 50+ Claude calls. A refactoring task? 100+ calls. Using Opus for everything means $3-10+ per task in API fees.

TYPICAL AGENT SESSION COSTS
Quick fix (20 calls)
$2.40$1.20
Debug session (80 calls)
$9.60$4.80
Feature build (200 calls)
$24.00$12.00
MONTHLY (heavy use)
$600+$300
agent-session.log
[09:41:02] Reading codebase... → haiku
[09:41:03] Analyzing imports... → haiku
[09:41:04] Planning refactor... → sonnet
[09:41:06] Writing new code... → sonnet
[09:41:08] Reviewing changes... → haiku
[09:41:09] Running tests... → haiku
[09:41:11] Complex debug... → opus
[09:41:15] Final review... → haiku
✓ Session complete8 calls · $0.34 (was $1.92)
55% SAVED
5
PROVIDERS
50%
AVG. SAVINGS
<1
MS ROUTING

Five Providers. One Interface.

Route between any model seamlessly

Anthropic
Claude 4.5 (Opus, Sonnet, Haiku)
OpenAI
GPT-5.2, o1, o3
Google
Gemini 2.0, 1.5
xAI
Grok-3, Grok-3-mini
Moonshot
v1-8k to 128k
// HOW IT WORKS

L3 Proxy Architecture

01

SDK Sends Request

POST /v1/messages

Any SDK respecting BASE_URL redirects through the local proxy

02

RelayPlane Routes

→ claude-3-5-haiku

Analyzes prompt, infers task type, selects optimal model for cost/quality

03

Provider Responds

← SSE stream

Direct connection to provider. Response streams back. Outcome logged.

// QUICK START

Three Commands to Start Saving

~/projects/my-agent
# 1. Set your API keys
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
# 2. Start the proxy
npx @relayplane/proxy --port 4100
# 3. Point your agent to the proxy
export ANTHROPIC_BASE_URL=http://localhost:4100
openclaw
✓ All requests now route through RelayPlane
// OPENCLAW SKILL v2.0.0

Agent Commands

Once the skill is installed, your agent can use these commands directly.

INSTALLAdd the RelayPlane skill to OpenClaw
$npx clawhub@latest install RelayPlane/relayplane

Telemetry Control

relayplane telemetry on

Enable anonymized telemetry (for Relay Network)

relayplane telemetry off

Disable telemetry completely

relayplane telemetry status

Show current telemetry settings

Dashboard & Stats

relayplane dashboard

Open the cloud dashboard in browser

relayplane stats

Show local routing statistics

relayplane status

Show proxy status and configuration

relayplane models

List available routing models and providers

All commands work inside your OpenClaw agent session. Just ask your agent to run them.

// ADAPTIVE INTELLIGENCE

Gets Smarter Over Time

RelayPlane doesn't just route — it learns from every request. Track outcomes, detect patterns, and continuously improve routing for your specific codebase.

Outcome Tracking
Records success/failure for each routing decision
Pattern Detection
Identifies what model combinations work for your code
Local Intelligence
All learning in SQLite — query your own data anytime
~/.relayplane/data.db
# View your stats
npx @relayplane/proxy stats --days 7
Routing Summary (7 days)
Total requests:1,247
Routed to Haiku:892 (71%)
Routed to Sonnet:298 (24%)
Routed to Opus:57 (5%)
Success rate:94.2%
Est. savings:$127.40
LEARNS FROM YOU
// ROUTING MODES

Choose Your Strategy

DEFAULT

Smart Routing

relayplane:auto

Infers task type from prompt, routes to optimal model. Best balance of cost and quality.

code_review → haiku
complex_analysis → sonnet
AGGRESSIVE

Cost Priority

relayplane:cost

Always routes to cheapest models. Maximum savings, upgrades on failure.

everything → haiku
# retry with sonnet if needed
CONSERVATIVE

Quality Priority

relayplane:quality

Uses best available model. Maximum quality, similar to no optimization.

everything → opus
# no downgrade
// TASK DETECTION

Automatic Classification

RelayPlane analyzes your prompts and infers task types to make optimal routing decisions.

code_generation

Writing new code

code_review

Reviewing, debugging

summarization

Condensing text

analysis

Deep reasoning

question_answering

Direct questions

data_extraction

Structured parsing

creative_writing

Stories, copy

translation

Language conversion

// CONFIGURATION

Config Reference

Config file: ~/.relayplane/config.json — hot-reloads on save.

~/.relayplane/config.json
{
  "enabled": true,
  "routing": {
    "mode": "cascade",
    "cascade": {
      "enabled": true,
      "models": [
        "claude-3-5-haiku-20241022",
        "claude-4-sonnet-20250514",
        "claude-4-opus-20250514"
      ],
      "escalateOn": "uncertainty",
      "maxEscalations": 1
    },
    "complexity": {
      "enabled": true,
      "simple": "claude-3-5-haiku-20241022",
      "moderate": "claude-4-sonnet-20250514",
      "complex": "claude-4-opus-20250514"
    }
  },
  "reliability": {
    "cooldowns": {
      "enabled": true,
      "allowedFails": 3,
      "windowSeconds": 60,
      "cooldownSeconds": 120
    }
  },
  "modelOverrides": {}
}

routing.mode

"cascade" — Try cheap models first, escalate on uncertainty

"standard" — Direct task-based routing

cascade.escalateOn

"uncertainty" — Escalate when model seems unsure

"refusal" — Escalate on refusal patterns

"error" — Escalate on API errors

complexity routing

Automatically classifies prompts as simple/moderate/complex and routes to the configured model for each tier.

reliability.cooldowns

Auto-disable failing providers. 3 failures in 60s triggers 120s cooldown.

// API REFERENCE

REST Endpoints

GET/control/status

Proxy status and current configuration

{ "enabled": true, "mode": "cascade", "modelOverrides": {} }
GET/control/stats

Aggregated statistics and routing counts

{ "totalRequests": 142, "successRate": "97.2%", "avgLatencyMs": 1203, "modelCounts": {...} }
POST/control/enable

Enable routing (returns { enabled: true })

{ "enabled": true }
POST/control/disable

Disable routing — passthrough mode

{ "enabled": false }
POST/control/config

Update config (merges with existing, hot-reload)

{ "ok": true, "config": {...} }

Proxy Endpoints

POST /v1/messages

Native Anthropic API — for Claude Code and direct Claude integrations

POST /v1/chat/completions

OpenAI-compatible API — works with any OpenAI SDK

// TROUBLESHOOTING

Common Issues

Proxy not running?

Start it with verbose mode to see what's happening:

npx @relayplane/proxy --port 4100 -v

Wrong model being used?

Check that your BASE_URL is set correctly:

echo $ANTHROPIC_BASE_URL  # Should be http://localhost:4100

Want to bypass proxy temporarily?

Unset the BASE_URL or add the bypass header:

unset ANTHROPIC_BASE_URL
# Or use header: X-RelayPlane-Bypass: true

How do I know routing is working?

Check the stats endpoint or look at proxy logs:

curl http://localhost:4100/control/stats

Getting 401 Unauthorized?

Make sure your API key is set:

export ANTHROPIC_API_KEY="sk-ant-..."

Start Saving Today

No sign-up. No cloud dependency. Just install and run.

100% OPEN SOURCEMIT LICENSEOPTIONAL TELEMETRY