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

✍️ OpenClawRadar📅 Published: March 17, 2026🔗 Source
OpenClaw Cost Optimization: How a Developer Fixed a $750 Mistake with Model Routing
Ad

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.

Ad

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

Ad

👀 See Also