Back to blog
EngineeringApril 6, 2026·10 min read

How to Keep OpenClaw Running on Claude Opus Without Draining Your Wallet

A step-by-step guide to migrating OpenClaw from Claude subscription auth to Anthropic API key, with cost optimization for crons, workflows, and model assignments.

Lance Jones

Lance Jones

How to Keep OpenClaw Running on Claude Opus Without Draining Your Wallet

At Toyo, we've been running workflow experiments with OpenClaw as the laboratory. It's how we stress-test what AI agents can actually do for small businesses: competitive intelligence, SEO research, content production, web design, strategic analysis. Real workflows producing real deliverables, not demos.

On Friday evening, April 3, Anthropic sent an email that changed everything for OpenClaw users with a Claude subscription: starting Saturday at noon Pacific, subscription limits would no longer cover third-party harnesses. The OpenClaw Anthropic relationship, as most of us knew it, was over.

We had less than 24 hours.

The Scramble

Within hours, the OpenClaw community was on fire. Reddit, X, Discord. Everyone trying to figure out what to do next.

Some people switched to GPT 5.4. OpenAI officially supports OAuth for OpenClaw, and 5.4 is a strong model. But the feedback was consistent: "It gets 99% of the job done, but the personality goes away." If you've built an agent with a voice, a character that knows your business and your communication style, GPT 5.4 produces competent but flat output. Pete Steinberger (OpenClaw's creator) has been working on fixes through system prompt engineering, but the community isn't convinced yet.

Others went open source. GLM, Kimi K2.5, MiniMax M2.7. You can run these through OpenRouter or host locally, and some people are running their entire agent stack on MiniMax for $10/month. The quality reports are mixed though. Fine for simple tasks, rough for multi-step reasoning and consistent voice. For a hobby setup, sure. For a system producing client deliverables, we weren't comfortable with the tradeoff.

Local hosting came up too. If you've got 64GB+ RAM and a decent GPU, Ollama lets you run models without paying a provider. But local hosting brings its own problems: you're responsible for model updates, hardware maintenance, and uptime. There's no redundancy unless you build it. And the quality gap between local models and Opus for strategic reasoning is still too wide for production work. It might make sense for specific workloads down the road, but it's not a drop-in replacement for a system that depends on top-tier reasoning.

A few people pointed out that claude -p (Claude's programmatic mode) still works with subscription auth. You could wrap it yourself and skip the harness. But then you're rebuilding session management, cron scheduling, and multi-channel routing from scratch. That's half of what OpenClaw already does.

We watched all of this play out over the weekend on Reddit, the OpenClaw GitHub discussions, and X. People trying things, reporting back, sharing what worked and what didn't.

We took a different approach.

We went with an Anthropic API key. And we used the forced migration as the reason to optimize everything. Not just swap the auth method. Actually audit every cron job, every workflow step, every model assignment. Ask whether each piece was earning its cost now that every token had a real price. The subscription had been hiding inefficiency behind a flat rate for months. This was the forcing function.

What We Were Running

Our OpenClaw setup runs on a Mac Mini sitting in a home office. It's the little engine behind Toyo's workflow experiments, not the production infrastructure for the company itself:

  • 1 persistent orchestrator (Gavin, Claude Opus) handling strategy, synthesis, and communication. (Yes, that Gavin.)
  • 9 ephemeral agent roles (engineers, researchers, designers, QA) spawned as disposable Claude CLI processes
  • 11 cron jobs running every 15 minutes to every 24 hours. Heartbeats, monitoring, memory capture, morning briefings, usage tracking, git backups.
  • 13 workflows. Competitive intelligence, SEO research, web design, content production, engineering sprints, strategic deliberation.
  • 29 competitor profiles produced through the pipeline, each a 15-20 page structured report pulling from 6 data sources

All authenticated through Claude subscription tokens. OAuth tokens that Anthropic was about to shut off.

Friday Night

The first question: are we dead at noon tomorrow?

Anthropic wasn't killing the tokens outright. They were moving third-party harness usage to "Extra Usage" at API rates, billed separately from the subscription. They offered a one-time credit equal to your monthly subscription price, redeemable by April 17. But we weren't ready to commit to pay-as-you-go without understanding our actual costs first.

We did have one card: our auth-profiles.json contained manually-pasted static tokens, not OAuth refresh tokens. They might survive the cutoff. We'd ride them until they died, then switch to an API key Monday with a full cost optimization pass.

Saturday: Life Support

The static tokens held. Sort of.

Saturday morning, the orchestrator (Opus) still responded. The morning brief (Sonnet) ran. But crons started failing. Intermittently at first, then cascading. By afternoon the pattern was clear:

ModelStatus
Opus (interactive)Working
Sonnet (crons)Intermittent
Haiku (crons)Mostly failing

The tokens were degrading. Some requests got through, others came back as instant rejections. Not timeouts. Outright blocks. The system was on life support.

We also had competitor profiles running through the pipeline when the cutoff hit. Several finished. A couple failed mid-workflow. The resume API saved the research (earlier steps were already on disk), but the ephemeral agents using Claude CLI were dead. CLI uses OAuth. Static tokens don't help there.

Sunday: Everything Fails

By Sunday, every cron was erroring. The morning brief that worked Saturday was dead. The orchestrator still responded to direct messages, but everything automated had collapsed.

11 active crons to 0 functional crons in 48 hours.

Monday: The Rebuild

Monday morning we committed. API key migration plus a full cost optimization pass. Here's what we did in one afternoon.

Setting Up an OpenClaw API Key for Anthropic (30 minutes)

Generated an Anthropic API key at console.anthropic.com. Tested with a raw curl call. Haiku responded. Added the OpenClaw API key as a new auth profile:

openclaw models auth paste-token --provider anthropic --profile-id anthropic:api-key

Set auth priority so the gateway uses the API key first, not the dead OAuth tokens:

openclaw models auth order set --provider anthropic anthropic:api-key

Gateway restart. Crons passed immediately.

Ephemeral Agent Auth (15 minutes)

The ephemeral agents (Claude CLI in tmux sessions) source ~/.openclaw/.env before running. Added ANTHROPIC_API_KEY to that file. Tested. Haiku responded. Workflows back online.

OpenClaw Cost Optimization: Crons, Workflows, and Model Assignment

On a subscription, tokens are bundled. You don't think about what each cron costs. With Anthropic API key billing, every token has a price. Claude code pricing at API rates ($15/M input for Opus, $3/M for Sonnet, $1/M for Haiku) forced a conversation we should have had months ago.

Cron pruning, 11 down to 7.

We killed 4 crons that were nice-to-have on a subscription but not worth paying for per-token:

  • Morning Brief (Sonnet, daily)
  • Nightly Status Ping (Haiku, daily)
  • Daily Self-Review (Haiku, daily)
  • OpenClaw Update Check (Haiku, daily)

We reduced frequency on the survivors:

  • Heartbeat: every 30 min to every 60 min, Sonnet to Haiku
  • Ephemeral Monitor: every 15 min to every 30 min
  • Session Memory Capture: every 2 hours to every 4 hours
  • QMD Re-index: every 4 hours to every 8 hours

Estimated savings: about $4.50/day. Roughly $135/month in cron overhead alone.


[IMAGE: Cron Jobs Panel] The surviving cron jobs. Down from 11. Everything that isn't green earned its way back.


Workflow model reassignment.

We reviewed the 5 most-used workflows and reassigned models step by step. The principle: Opus for creative and strategic work, Sonnet for everything mechanical.

Example, the SEO opportunity research workflow:

  • Discovery proposal: Opus to Sonnet (it's a scope document, not creative work)
  • Ecosystem research: stays Sonnet
  • Competitor gap: Opus to Sonnet (data comparison, not judgment)
  • Opportunity scoring: stays Opus (requires strategic reasoning about buyer fit)
  • Content strategy: Sonnet to Opus (upgraded, this is the creative deliverable)
  • QA verify: Opus to Sonnet (rubric scoring is mechanical)

Same logic across all workflows. Opus runs only where human-grade reasoning matters. Everything else is Sonnet at a fifth of the cost.


[IMAGE: Usage Dashboard] Day one on API billing. Cron jobs: $0.35. The subscription was $100/month.


Usage Dashboard Overhaul

While we were in there, we fixed the dashboard too:

  • Added a billing epoch cutoff so costs from the subscription era don't pollute the API billing view
  • Built a cost-by-source breakdown showing spend across interactive conversations, cron jobs, and workflow agents. First reading: Interactive $3.42, Cron $0.46.
  • Modified the agent spawn script to output usage JSON per run. Every workflow step now has cost data.

OAuth Cleanup

Removed all dead OAuth tokens from both agent auth configs. One provider, one profile, one key.

What We Learned

Subscription auth was making us lazy. When tokens are bundled, you don't question whether 11 crons firing every 15 minutes is a good idea. API billing made us ask "is this cron worth $0.50/day?" and the answer was often no.

The system came out leaner. 7 crons instead of 11. Haiku for mechanical work, Opus only for judgment. Usage tracking per workflow step. Cost-by-source visibility. We're running a tighter operation now, and we actually understand the economics of it.

Static tokens bought time. They're not a plan. The manually-pasted tokens survived 48 hours. That was luck. If we'd relied on that, we'd have woken up one morning to a dead system with no warning.

24 hours notice was brutal but survivable. We had active workflows running when the cutoff hit. Two failed mid-execution. But ephemeral agents write output files to disk at every step, so we lost 2 steps, not 2 entire workflows. The research was saved. We resumed from where it failed.

Multi-provider is the real long-term answer. Right now we're 100% on Anthropic API. That's a single point of failure. Next step is routing some workloads through OpenAI Codex or Gemini. We already have auth for both. Depending on one vendor for your entire AI infrastructure is the same mistake we just got burned for.

The Numbers

MetricBefore (Subscription)After (API Key)
Auth methodOAuth tokens (dead)API key (direct billing)
Active crons117
Cron frequencySome every 2-15 minMinimum 30 min
Cron modelMix of Opus/Sonnet/HaikuAll Haiku
Workflow modelsOpus-heavyOpus for creative, Sonnet for mechanical
Cost visibilityNone (flat rate)Per-call, per-source, per-workflow-step
Estimated cron costUnknown (bundled)~$4.50/day ($135/mo)
Daily interactive costUnknown~$3-5/day
Ephemeral agent trackingNonePer-step JSON with token breakdown
Time to rebuild~4 hours

How to Migrate OpenClaw from Claude Subscription to API Key

If you're still on subscription tokens, here's the playbook:

  1. Get an API key now. Don't wait for your tokens to die. console.anthropic.com, API Keys, Create. Load $50 to start.
  2. openclaw models auth paste-token --provider anthropic --profile-id anthropic:api-key
  3. Set auth priority: openclaw models auth order set --provider anthropic anthropic:api-key
  4. Add it to your .env for Claude CLI tools: ANTHROPIC_API_KEY=sk-ant-api03-...
  5. Audit your crons. You're probably running more than you need. API billing makes the cost visible.
  6. Downgrade models on mechanical work. Haiku for monitoring, cleanup, backups. Sonnet for QA and reviews. Opus only for creative work and live conversations.
  7. Claim the $100 credit if you haven't. Redeemable until April 17.

The whole thing, from "we're going to lose everything" to "running leaner than before," took one afternoon.


Built with OpenClaw on a Mac Mini as part of Toyo's workflow experiments. Orchestrated by Gavin (Claude Opus). Written by a human who almost lost his AI team on a Saturday.