OpenClaw Cost Optimization: How a Developer Fixed a $750 Mistake with Model Routing

What Went Wrong with the Cost Fix
After burning $750 in 3 days on OpenRouter, the developer initially "fixed" costs by swapping everything to Hunter Alpha (free on OpenRouter). This caused subagents to return zero output — silent completions where jobs showed "success" but results were empty.
A specific failure case: a video production agent wrote code that syntax-checked correctly, ran without errors, but produced a 9-second silent black video with no voiceover, no footage, and no manifest. QA eventually caught it. The lesson: free models don't always fail loudly — sometimes they quietly ship a stub and move on.
The New Model Routing Strategy
The developer stopped thinking "cheap vs expensive" and started thinking "what does this task actually need":
- Main session (orchestration): Sonnet 4.6 — "The manager. Worth the cost."
- Code/complex tasks: Gemini 2.5 Flash at $0.15/M — "Sweet spot for real output."
- Sensitive data (credentials, financials): Claude 3.5 Haiku — "Anthropic doesn't log prompts. Non-negotiable."
- Simple predictable tasks: Hunter Alpha — "Fine when failure is obvious and stakes are low."
Every cron job and subagent spawn now has an explicit model parameter — no defaults.
Security Discovery During the Audit
While investigating the model issues, the developer found credentials committed in their workspace repo — API keys and OAuth tokens. Although not pushed publicly, this was unacceptable. They added a .gitignore for credentials/ and ran git rm --cached. The warning: if you've ever committed a credentials folder, those keys remain in your git history — rotate them.
The Core Lesson
Cost optimization isn't a one-time config change. A $0.15/M model writing your production pipeline is money well spent. A free model that silently passes you a broken video is expensive no matter what it costs per token. Right-size to the job and verify output, not just exit codes.
📖 Read the full source: r/openclaw
👀 See Also

Reddit user reports better results with Claude after changing prompting approach
A developer spent days struggling with multiple AI tools before finding success with Claude by shifting from search-engine style prompts to back-and-forth conversations with specific context about why approaches weren't working.

Developer Replaces AI Agent with Direct Playwright Script for Browser Automation
A developer used OpenClaw to spawn a Gemma 4 31B agent for browser automation via Playwright but encountered issues with incorrect API calls and timeouts. They replaced the entire agent with a 50-line script that communicates directly with Chrome, completing the task in 10 seconds.

OpenClaw's Bub AI agent struggles with delegation, burns $20 in 15 minutes during mobile site optimization
During QA for Driftwatch V3, the OpenClaw bot Bub burned $20 in 15 minutes by failing to delegate tasks properly. The developer discovered detailed spec templates reduce costs, while mobile retrofitting added unexpected time and expense.

Splitting AI Agents to Prevent Context Dropping
A developer describes splitting a single AI agent into three specialized agents with separate memory and workspaces to prevent context window issues. The agents communicate through a simple mailbox system to coordinate tasks like trip planning.