Your AI agent was supposed to save you money. Then you opened the provider dashboard and saw a number that did not match the work. Last month the bill was $40. This month it is $280, and nothing about your workflow changed. Or worse, the cost is climbing every day while the agent sits mostly idle.
This is one of the most common complaints from people running agents in 2026, and it almost never means the provider overcharged you. It means the agent is doing more billable work than you think. Agent workloads use 5 to 30 times more tokens than chat because every step re-sends the conversation, and tool results get added to that pile. A single task can become 20 or 50 model calls instead of one.
The good news: the leak is usually in one of five places, and four of them are free to fix. Below is how to find yours, in order, and what to change.
Why Your AI Agent Bill Keeps Climbing
Chat is cheap because each message is a short, one-off request. An agent is a loop. It reads the task, calls a tool, reads the result, decides the next step, and repeats. Every one of those turns sends the entire history again: the original instructions, every earlier tool output, every failed attempt.
That means cost compounds inside a session. Turn one might cost a fraction of a cent. Turn thirty carries thirty turns of baggage and costs many times more. If the agent never clears that history, a long-running thread gets more expensive with every message.
Three other multipliers sit on top. Idle heartbeats wake the agent on a schedule and re-bill the full prompt even when there is nothing to do. Retry loops repeat a failed call with the same large context until a step limit stops them. And a frontier model asked to format a date or classify an email costs 20 to 40 times more than a small model doing the same job.
Cache misses make it worse. If the start of your prompt changes on every request, the provider cannot reuse the cached prefix, so you pay full input price for thousands of tokens you have already sent a hundred times.
How to Confirm Where the Money Is Going
Do this before you change any settings. Ten minutes of looking beats a week of guessing.
- Look at input tokens per request, not the monthly total. Every major provider shows usage per request or per key. If input tokens grow steadily through a session, context accumulation is your main leak.
- Compare request count to tasks completed. Count the model calls for one real task. A simple lookup that takes 25 calls is looping. Healthy agents usually finish routine work in 3 to 8 calls.
- Check what happens while you are asleep. Filter usage by hour. Requests at 3am with no user message mean a heartbeat, a poll, or a cron job is running the agent for no reason.
- Check which model handled the cheap work. If your logs show the top-tier model handling summaries, classifications, and formatting, you are overpaying for most of your volume.
- Check your cache hit rate. If prompts over 1,000 tokens show zero cached input, something near the top of the prompt is changing every call, such as a timestamp, a session ID, or a reordered tool list.
- Look for duplicate calls. Retries after a timeout, two gateways sharing one token, or a tool that fires twice will all show as extra requests with near-identical input.
Write down which of these six shows the biggest number. That is your first fix, not the last one.
The Fix, From Free to Paid
1. Cap the loop and slow the heartbeat
Set a hard maximum on steps per task and on retries per failed call. Most agent frameworks let you set this in config; if yours does not, that is a reason to move. A task that needs 40 steps usually needs a better plan, not more budget.
Then fix the heartbeat. An agent checking in every 15 minutes burns four times the idle tokens of one checking every hour. If your cache TTL is one hour, an interval just under that, around 55 minutes, avoids re-writing the cache on every wake. Disable heartbeats entirely for agents that only work when you message them.
Expected result: 30 to 60 percent off the bill for most people, with no loss in quality. This is the free fix that solves the problem for a lot of readers, and it is worth doing before you pay anyone.
2. Route by task, not by habit
Not every call needs the most expensive model. Formatting, extracting fields, summarizing a short thread, and classifying an email all run fine on a small model at roughly $0.10 to $0.60 per million tokens. The frontier tier runs $2 to $20 per million. That is a 20 to 40 times difference on the same volume.
Set a default small model and escalate only when a task fails a quality check or genuinely needs reasoning across many documents. If you are unsure whether the cheaper model is good enough, run last week’s real tasks through both and compare outputs. Keep the split simple: fast model for the 80 percent of calls that are mechanical, strong model for the rest.
Expected result: the largest single cut for most agent users. If your bill drops by half after this step, you found the real problem.
3. Stop replaying the whole transcript
Long sessions are the quiet killer. Cap the history the agent carries, summarize older turns instead of keeping them verbatim, and start a fresh session per task instead of running one thread for a week. Tool output is the worst offender: a full API response or a scraped page can add thousands of tokens that get re-sent on every following turn. Keep the useful fields and drop the rest.
If your agent gets slow and vague in long chats as well as expensive, the cause is the same. There is a step-by-step walkthrough in this guide to fixing context overflow.
Expected result: cost per task flattens instead of climbing, and answers get sharper because there is less noise in the window.
4. Turn on prompt caching properly
Caching is the biggest discount most people leave on the table. On Anthropic, a cache read costs about 10 percent of the normal input rate, a 90 percent saving. OpenAI’s automatic caching takes 50 to 80 percent off input for prompts over 1,024 tokens. Google offers similar discounts on supported models.
It only works if the start of the prompt stays identical. Put static instructions first, keep the tool list in a fixed order, and move anything dynamic, like the current time or a run ID, to the end. A single timestamp at the top of the system prompt can drop your hit rate to zero.
Expected result: 50 to 90 percent off input tokens on repeated prompts. This pairs well with fix 1, because a stable prompt plus a sensible heartbeat keeps the cache warm.
5. Put a ceiling on spending today
Set a monthly spend limit and a low-balance alert with your model provider, and use a separate API key per agent so one runaway loop cannot drain the account you use for everything else. Review the bill weekly for the first month. You are looking for a jump of more than 20 percent without a matching jump in useful output.
This does not reduce cost by itself. It stops a bad night from becoming a bad month, which is the difference between a $30 lesson and a $600 one.
6. Pay for managed hosting when the ops work is the leak
If the fixes above work but you keep drifting back into the same problem, the leak is not tokens. It is time. You are the person debugging retry loops, patching the runtime, and checking whether the process survived a reboot.
That is the case where a managed platform earns its fee. ClawTrust runs OpenClaw for you, with zero exposed ports, updates handled, and a 5-day free trial. Plans start at $29 per month. You keep your own model keys and controls; you stop being the on-call engineer for your own assistant.
Quick Comparison of the Fix Options
| Option | Best For | Starting Price | Rating | Get Started |
|---|---|---|---|---|
| Self-hosted OpenClaw plus the free fixes | People who want full control and already run a VPS | $6 to $20/mo VPS plus API usage | 4.5/5 | openclaw.ai |
| OpenClaw Cloud | One agent, zero server maintenance | $49/mo, $39/mo billed yearly | 4/5 | See plans |
| ClawTrust managed hosting | Owners who want the ops handled and a trial before committing | $29/mo, 5-day free trial | 4.5/5 | Try ClawTrust free |
When It Is Worth Paying
Run the free fixes first and check the bill after one week. If cost drops and stays down, you do not need to pay anyone. That is a real outcome for most single-agent setups under about 100 tasks a month.
The math changes when your time is the cost. If you bill $75 an hour and lose three hours a month to config drift, restarts, and mystery failures, that is $225 of your time to save a $30 hosting fee. Paying $29 to $49 a month to stop doing that is not a splurge, it is a trade.
Pay for managed hosting when at least two of these are true: you have been fixing the same runtime problem twice, you need the agent to survive reboots without you, or you cannot afford a night of downtime. Stay self-hosted if you enjoy the control, your agent touches sensitive internal systems you want to isolate yourself, or your usage is light enough that a small VPS plus a stable config is genuinely enough.
One thing worth saying plainly: if your bill is high because the agent is doing work that matters, that is not a leak. Track cost per useful task, not cost per month. An agent that costs $80 and replaces six hours of manual work is cheaper than one that costs $20 and does nothing.
Three causes cover most cases. A retry loop after a provider timeout re-sends the same large context dozens of times. A heartbeat or cron job starts waking an idle agent on a schedule. Or a long session kept growing, so every new turn re-sent more history than the last. Check requests per hour and input tokens per request before assuming a price change.
For most routine steps, yes. Classification, formatting, extraction, and short summaries run fine on small models that cost a fraction of the frontier tier. Hard multi-step reasoning and long-document analysis still benefit from the stronger model. Test with your own real tasks rather than guessing, and route per task instead of picking one model for everything.
Yes, and it is the largest discount available. Cached input reads cost about 10 percent of the normal rate on Anthropic and 20 to 50 percent on OpenAI, depending on the model. The catch is that the prompt prefix must stay identical, so static instructions go first and dynamic values like timestamps go last.
Light personal use with a small model runs $5 to $10 a month in API calls plus a $6 to $20 VPS. A working agent handling daily tasks usually lands between $30 and $80 including hosting. Heavy use with a frontier model and long sessions can pass $200. If you are far outside those ranges, check the six causes above before assuming the provider is expensive.
Most providers offer a monthly spend limit and low-balance alerts, though some limits are soft and can lag behind real usage. The reliable setup is a separate API key per agent plus a provider-level cap plus a step limit in the agent itself. That combination stops one runaway loop from draining the account you use for everything else.
Final Thoughts
Do this in the next ten minutes, in this order.
- Open your provider usage page and find input tokens per request for the last week. If that number grows through each session, your leak is context replay.
- Set a monthly spend limit and a low-balance alert, then create a separate API key for the agent.
- Set a step limit of 15 per task, a retry limit of 2, and a heartbeat interval between 30 and 55 minutes. Disable the heartbeat for agents that only respond to messages.
Then wait a week and compare cost per useful task, not the raw total. If the bill is still climbing after those three changes, reread fix 2 and fix 4, because model routing and cache misses are the next biggest levers. If the cost is fine but the maintenance is not, that is the point where managed hosting is the honest answer rather than another weekend of debugging. For the model routing side, this guide to fixing session pins and fallbacks explains how to stop expensive models from quietly handling cheap work.
If the cost is under control but the maintenance is not, see how OpenClaw, Hermes, Meta Muse and Claude compare on running costs, setup time and control.
See Our ComparisonThis post contains affiliate links. If you buy through them, I may earn a small commission at no extra cost to you.

