AI agent runaway cost calculator
Last updated 25 November 2026
What does an AI agent cost when it gets stuck in a loop and nobody notices? Each step of an agent loop sends the whole conversation again, so every step costs more than the one before. Pick a model and how long the loop could run, and see the bill.
Uses the same prices Xpenvo Agents charges budgets with, checked every 6 hours (see AI model prices). Nothing you type leaves your browser.
for 27,900 steps of claude-sonnet-5-5. The first step costs $0.0480; by the end each step costs $0.21, about $94 an hour.
The context stops growing at 100K tokens, where most frameworks start trimming old messages. Raise it to see an agent that keeps everything.
| If it runs for | It costs |
|---|---|
| 1 hour | $89 |
| A working day (8 h) | $744 |
| Overnight (14 h) | $1,306 |
| A weekend (62 h) | $5,799 |
| A week (168 h) | $15,720 |
the loop is stopped after 117 steps, and the bill is $20 at most instead of $5,799.
Why loops get expensive so fast
- Every step re-sends everything. An agent sends the whole conversation, tool results included, on every call. A loop that adds 1,500 tokens a step is sending 100,000 tokens a call after about 50 steps.
- Agents do not get tired. A retry loop or two agents answering each other can run all night or all weekend. A step every few seconds is thousands of calls a day.
- Provider limits come late. Usage limits and billing alerts at the provider are usually checked after the spending, with a delay, and cover the whole account rather than one agent.
- Caching helps, but does not stop it. Cached input is cheaper, yet the output and the new tokens of every step are still paid in full.
How to stop it
Xpenvo Agents checks what each request could cost before it is sent, and refuses it when it would go over the agent’s budget. It also spots an agent sending the same thing again and again, can ask a person to approve an unusually big request, and has a kill switch for every agent at once. You keep your own provider key; setup is a new base URL and one header.
Join the free beta Try the demo
Read more: How to stop runaway agent loops.
Assumptions
Standard (not batch or priority) prices, in US dollars. Long-context prices apply once the context passes the model’s long-context threshold. Cache writes are not counted, so a real bill with caching can be a little higher. Your own discounts are not included.