Post-Mortem: Claude Max + OpenClaw Billing Errors from Stale OAuth and Isolated Cron Jobs

✍️ OpenClawRadar📅 Published: May 12, 2026🔗 Source
Post-Mortem: Claude Max + OpenClaw Billing Errors from Stale OAuth and Isolated Cron Jobs
Ad

A self-hosted OpenClaw setup with Claude Max started returning billing error — API key has run out of credits despite being well under quota. Two days of debugging revealed two root causes and a kill chain that makes the failure appear random.

Root Cause 1: Stale OAuth Token Poisons Whole Provider

The auth-profiles.json had two entries: a valid anthropic:claude-cli OAuth profile and an anthropic:manual profile with an sk-ant-oat01-... token. When the manual token expired, OpenClaw didn't just fail that profile — it classified it as a provider-level billing failure and blacklisted the entire anthropic provider, skipping every model including the healthy OAuth profile. Logs showed:

reason: "billing" errorPreview: "Provider anthropic has billing issue (skipping all models)" chain_exhausted

The healthy OAuth profile with a valid refresh token was never tried.

Fix: Remove anthropic:manual entirely from auth-profiles.json and openclaw.json. Keep only anthropic:claude-cli.

Root Cause 2: Isolated Cron Jobs Hit a Separate Billing Bucket

OpenClaw has two execution paths:

  • Main sessions — runs /usr/bin/claude binary, billed to Max/Pro subscription ✅
  • Isolated/embedded runs — direct HTTP to Anthropic API, billed to Extra Usage bucket

Cron jobs with sessionTarget: isolated spin up a standalone embedded agent that calls the Anthropic API directly via HTTP — without the Claude Code headers the CLI sends. Anthropic routes it to the Extra Usage bucket, a completely separate quota. With Extra Usage off, every isolated cron run returns a 400. OpenClaw then worsens it: one billing error sets disabledUntil ~24 hours forward in auth-state.json, locking out all requests — including normal chat — until cooldown fires. The lockout survives gateway restarts.

Ad

The Full Kill Chain

  1. Gateway restart → missed cron job queues for catch-up
  2. Isolated agent fires via embedded runner → direct HTTP call to Anthropic API (no CLI headers)
  3. Extra Usage bucket → 400 error
  4. OpenClaw locks auth profile for ~24h → all requests blocked including normal chat

Fixes

  1. Clear the billing lockout immediately:
    python3 -c "
    import json
    with open('/home/USER/.openclaw/agents/main/agent/auth-state.json') as f:
        d = json.load(f)
    if 'usageStats' in d:
        for profile in d['usageStats']:
            d['usageStats'][profile].pop('disabledUntil', None)
            d['usageStats'][profile].pop('failureCounts', None)
            d['usageStats'][profile].pop('errorCount', None)
            d['usageStats'][profile].pop('disabledReason', None)
            d['usageStats'][profile].pop('lastFailureAt', None)
    with open('/home/USER/.openclaw/agents/main/agent/auth-state.json', 'w') as f:
        json.dump(d, f, indent=2)
    print('Cleared.')
    "
    openclaw gateway restart
  2. Move all cron jobs from isolated to main:
    python3 -c "
    import json
    with open('/home/USER/.openclaw/cron/jobs.json') as f:
        d = json.load(f)
    jobs = d if isinstance(d, list) else d.get('jobs', [])
    for j in jobs:
        if j.get('sessionTarget') == 'isolated':
            print(f'Fixing: {j["name"]}')
            j['sessionTarget'] = 'main'
    with open('/home/USER/.openclaw/cron/jobs.json', 'w') as f:
        json.dump(d, f, indent=2)
    print('Done.')
    "

Who it's for: Anyone self-hosting OpenClaw with Claude Max or Pro who sees random billing errors despite being under quota.

📖 Read the full source: r/openclaw

Ad

👀 See Also

Running a 1 Trillion Parameter LLM Locally on AMD Ryzen AI Max+ Cluster
Guides

Running a 1 Trillion Parameter LLM Locally on AMD Ryzen AI Max+ Cluster

AMD demonstrates running the Kimi K2.5 open-source model (375GB, 1 trillion parameters) across four Framework Desktop systems with Ryzen AI Max+ 395 processors using llama.cpp RPC. The guide covers TTM kernel modifications for 120GB VRAM per node and provides two setup options: Lemonade SDK pre-built binaries or manual ROCm 7.0.2 installation.

OpenClawRadar
Model Routing Baselines for Claude and OpenAI Usage
Guides

Model Routing Baselines for Claude and OpenAI Usage

A developer shares their model routing strategy using Claude Haiku 4.5, Sonnet 4.6, Opus 4.6, and ChatGPT 5.3 Codex for different task types, with fallbacks to GPT-5 Mini and GPT-5.4 when needed.

OpenClawRadar
Setting up OpenClaw on macOS with a unified AI provider endpoint
Guides

Setting up OpenClaw on macOS with a unified AI provider endpoint

A developer shares their experience installing OpenClaw on macOS, including the requirement for Node.js 24, using Homebrew for installation, configuring a custom OpenAI-compatible provider like ZenMux, and setting up a background daemon. Key troubleshooting tips include WhatsApp's default message blocking and using the openclaw doctor command.

OpenClawRadar
Debugging OpenClaw + Ollama Local Model Timeouts: Five Fixes for Silent Failures
Guides

Debugging OpenClaw + Ollama Local Model Timeouts: Five Fixes for Silent Failures

A developer identified five root causes for OpenClaw agents silently timing out with local Ollama models like Gemma 4 26B, including a blocking slug generator, a 38K character system prompt, and hidden timeouts. The fixes involve disabling hooks, modifying configs, and adjusting Ollama settings.

OpenClawRadar