AI agent loop cost calculator

What would one agent cost if it got stuck and nobody noticed? Put in your own numbers.

System prompt, tools and the task.
The tool result plus the reply.
Where the context stops growing.
The model's output.
From your provider's price list.
From your provider's price list.
Including the tool's own time.
What one looping agent would cost
Left running forStepsCost
One hour180$72.20
Overnight (8 hours)1,440$837.65
One day4,320$2,587.25
A weekend8,640$5,211.65

The prices start as round examples, not any model's. Nothing you type here leaves this page.

Why the number grows so fast

An agent resends its whole history on every step, so each step costs more than the last until the context limit holds it flat. The guide to why AI agent loops get expensive works through it step by step, and how to set a budget for an AI agent shows how to put a ceiling on it.

Spend is in early access: you can set budgets and see what each call cost today, and budgets that stop calls are being switched on across the platform.

Questions

How is the cost worked out?
Each step sends the starting context plus everything added so far, up to the context limit. Input tokens are summed across all steps and multiplied by the input price, and output tokens by the output price.
What doesn't it count?
Prompt caching, which lowers the cost of resent input, and retries of failed calls, which raise it. It also treats the context limit as a flat ceiling. Real agents trim their context in different ways, so treat the result as an estimate.
Where do I find my numbers?
Your provider's usage data shows tokens per call, and its price list shows prices. To see how the context grows, compare the input tokens on the first few steps of a real run.