OpenClaw Cost Optimization: The Complete Guide

OpenClaw sends every request to Claude Opus by default — even file reads and simple questions. That's like taking a helicopter to the corner store. Here's how to fix it.

The Problem: Opus for Everything

A typical OpenClaw session runs 50-200 API calls. At Opus pricing ($15/MTok input, $75/MTok output), a single coding session can cost $5-20. But 60-80% of those calls are simple tasks that a cheaper model handles identically.

Strategy 1: Intelligent Model Routing

RelayPlane's Relay Network analyzes each request and routes simple tasks to cheaper models automatically. No code changes needed.

# Install the proxy
npm install -g @relayplane/proxy

# Initialize (first-time setup)
relayplane init

# Point your tools at it
export ANTHROPIC_BASE_URL=http://localhost:4100
export OPENAI_BASE_URL=http://localhost:4100

# Start the proxy
relayplane start

40-60%

Cost reduction

0 lines

Code changes

Real-time

Cost dashboard

Strategy 2: Response Caching

OpenClaw often re-reads the same files multiple times in a session. RelayPlane caches identical requests, serving instant responses at zero cost for repeated queries.

# In ~/.relayplane/config.json, add:
{
  "cache": {
    "enabled": true,
    "ttl": 300
  }
}

Strategy 3: Budget Controls

Set daily, weekly, or per-session spending limits. Get alerts before you hit them. Never wake up to a surprise bill again.

# In ~/.relayplane/config.json, add:
{
  "budget": {
    "daily": 10.00,
    "alertAt": 0.8,
    "action": "warn"
  }
}

Start Saving Today

Free tier includes 1,000 requests/day. No credit card required.