Skip to content
← All posts

Why your model bill creeps up every month

Agents do not bill like chatbots. Heartbeats, growing context, retries and cache misses each cost almost nothing per call and a lot per month. Here is where the money actually goes.

5 min read costself-hosting

The bill for a chatbot is easy to reason about: you send a message, you pay for a message. The bill for an agent is not, and the difference catches people out in a specific way — the number goes up every month, nothing obvious changed, and no single line item looks wrong.

The reason is that agents spend money when you are not typing.

Cost per call is the wrong unit

Look at any provider’s pricing page and you get a per-million-token price. Multiply by the length of your typical exchange and you get a number that sounds trivially small. That arithmetic is correct and almost useless, because it assumes calls happen when you ask for them.

The unit that actually predicts your bill is cost per day of the agent simply existing. An agent that costs a fraction of a cent per call and makes a call every five minutes, unattended, is a subscription you did not knowingly sign up for. Twelve calls an hour is 288 a day is roughly 8,600 a month, and that is before you have used it for anything.

Once you switch to that unit, the four common leaks become obvious.

Leak one: heartbeats and idle loops

Many agent setups have a periodic tick — checking for new messages, polling a channel, running a scheduled prompt, deciding whether anything needs doing. Each tick is a model call, and each of those calls typically carries the agent’s system prompt and some amount of context.

This is the leak that surprises people most, because its cost is completely decoupled from your usage. You can take a week off and the spend continues at the same rate. If your bill is roughly flat regardless of how much you actually used the agent, you are looking at this.

What to check: any interval-based configuration in your agent — polling frequency, heartbeat, keep-alive, scheduled checks. Then multiply by the days in a month before deciding it is fine.

Leak two: context that grows

The second leak is subtler because it looks like normal operation. Input tokens are billed per call, and an agent that accumulates conversation history sends more of them every time.

A session that starts at 2,000 tokens of context and grows to 40,000 over a long working session is not costing you twenty times more at the end — it is costing you twenty times more for every remaining call in that session. Long-lived sessions with no trimming are the usual culprit. So are agents given large documents or file trees “for context” that are re-sent on every turn.

What to check: whether your sessions have a context window strategy at all — truncation, summarisation, or just being reset regularly. A session that has been open for three weeks is a cost problem regardless of how useful it has become.

Leak three: retries and loops

Agents retry. A tool call fails, the model tries again. A malformed response gets re-requested. A task that the agent cannot complete may be attempted repeatedly before something gives up.

Every one of those attempts is billed. Worse, retry loops tend to trigger in exactly the situations you are not watching — an API that started returning errors overnight, a tool whose credentials expired, a task that is subtly impossible.

What to check: your logs for repeated near-identical calls, and whether your agent has a retry ceiling. An agent that can retry indefinitely has an unbounded bill.

Leak four: cache misses you did not notice

Providers offer prompt caching, and it is a large discount on repeated input — often the difference between paying full price for a long system prompt on every call and paying a fraction of it.

Caching is also fragile in a way that is easy to miss. It generally requires the cached prefix to be byte-identical and reused within a time window. Anything that varies the front of your prompt — a timestamp, a session id, a dynamically assembled tool list whose order is not stable — can quietly disable it. Nothing errors. Your costs just go back up to the undiscounted rate.

What to check: whether anything variable appears near the start of your prompts, and whether your provider’s usage reporting shows cache hits at the rate you expect.

Why you find out late

All four leaks share a property: they produce a slow, smooth increase rather than a spike. There is no moment where something obviously breaks. Provider dashboards mostly show you what you have already spent, which means the earliest natural signal is the invoice — by which time the month is over and the money is gone.

What you want instead is a projection: not “you have spent $34 so far” but “at your current rate you will finish the month at $210, and your budget is $100.” Those are the same underlying data and completely different information. The first is history; the second is a decision you can still act on.

The arithmetic is not hard — spend so far, divided by days elapsed, multiplied by days in the month. The reason it does not happen is that nobody remembers to do it on the tenth of the month, which is the only day it would have helped.

What to actually do

Set a hard limit at your provider. Most support a monthly spending cap or a budget alert. This is the only control that cannot be undone by a config mistake on your side, and it takes two minutes. Do this first, whatever else you do.

Audit your intervals. Find every periodic task and ask whether it needs to run that often. Going from every five minutes to every thirty is an 83% reduction in that line item, and for most idle-check purposes it is not a meaningful loss.

Give sessions a lifespan. Truncate, summarise, or reset. Unbounded context is unbounded cost.

Cap retries. A ceiling on attempts turns an unbounded failure into a bounded one.

Check your cache hit rate. If you have a long system prompt and no cache hits, fixing that is usually the single largest saving available.

Project, do not review. Whatever tool you use, the question worth answering monthly is “where does this end up”, not “where has it been”.

That last one is why GambaOS has a cost guard: you set a monthly budget, and it extrapolates month-end spend from your current rate and warns you at your threshold — while there is still a month left to change something. The rest of this list you can do today, by hand, and you probably should.

Get GambaOS when it launches

The panel this article talks about opens for download soon. Leave an email and be first in.

One email when it launches. Unsubscribe anytime.