Skip to content

staybased/openclaw-claude-cli-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

OpenClaw Claude CLI Backend Fix

🚨 URGENT: April 4th, 2026 Anthropic billing change breaking OpenClaw? This fixes it.

Save 90%+ on OpenClaw costs by routing through your Claude Max subscription instead of expensive API billing.

The Problem

As of April 4, 2026, Anthropic no longer allows Claude Pro/Max subscriptions to cover third-party tools like OpenClaw. Users now face expensive API billing at $15-75/million tokens instead of flat subscription rates.

Impact: OpenClaw becomes prohibitively expensive for active users ($50-200/day vs $200/month)

The Solution

Route OpenClaw through Claude Code CLI backend - uses your subscription quota instead of API billing.

Result: Same OpenClaw functionality at subscription cost, not per-token.

Quick Fix (5 minutes)

# 1. Configure CLI authentication
openclaw models auth login --provider anthropic --method cli --set-default

# 2. Fix CLI backend path
jq '.agents.defaults.cliBackends = {"claude-cli": {"command": "/opt/homebrew/bin/claude"}}' ~/.openclaw/openclaw.json > /tmp/openclaw_fixed.json && mv /tmp/openclaw_fixed.json ~/.openclaw/openclaw.json

# 3. Use correct model aliases (CRITICAL FIX)
openclaw models set claude-cli/opus

# 4. Restart gateway
openclaw gateway restart

Verification

Check logs for successful CLI routing:

tail -f /tmp/openclaw/openclaw-$(date +%Y-%m-%d).log | grep "cli exec"

Should see: "cli exec: provider=claude-cli model=opus"

Key Discovery

Root cause of "Unknown model" errors: OpenClaw was using versioned model names, but Claude CLI only accepts simple aliases:

  • claude-cli/opus
  • claude-cli/sonnet
  • claude-cli/claude-opus-4-6
  • claude-cli/claude-sonnet-4-20250514

Cost Comparison

Method Cost Notes
API Billing (old) $15-75/million tokens $50-200/day for active agent
CLI Backend (new) Subscription quota only ~$0/day, quota limits apply

Requirements

  • ✅ Claude Max subscription ($200/month)
  • ✅ Claude Code CLI installed (claude --version)
  • ✅ OpenClaw 2026.4.2+

Limitations

  • Claude Code has 5-hour active windows + weekly resets
  • Not unlimited, just subscription-pooled instead of per-token
  • For heavy usage (245+ sessions), consider model tiering

Status

Production tested - Currently running stable for power user with 245+ sessions
Zero code changes - Just configuration fixes
Community ready - Documented for immediate deployment

Contributing

Found this helpful? Issues/improvements welcome!

License

MIT - Help the OpenClaw community avoid the billing crisis.


Tested on: OpenClaw 2026.4.2, macOS arm64, Claude Code 2.1.37
Author: StayBased
Date: April 4, 2026

About

Fix OpenClaw April 4th Anthropic billing crisis: Route through Claude CLI backend for 90%+ cost savings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors