
TL;DR
|
Key takeaway: an agent decides how much work a task needs while it's doing it, so two tasks that look identical can cost very different amounts.
Yesterday, an AI agent reviewed a pull request and spent about fifty cents. Today it reviewed one that looked much the same and spent five dollars. Same workflow, same repository, same model.
Ask the engineer who set it up what happened, and the answer is usually a shrug. The agent did its job both times. It just did a lot more of it the second time.
That's hard to budget around, because most of what IT leaders pay for is steady. A reserved server or a software licence costs what you agreed to pay for it. Even usage-based infrastructure tends to follow traffic you can see coming. A spreadsheet and a few months of history will forecast most of it.
An agent works things out as it goes. It reads the code, decides what else it needs to look at, calls the model, checks the answer, and sometimes tries again. Every one of those choices costs tokens and time, and none of them are known when the task starts. You find out what a task cost when it's finished.
That unpredictability is attached to a fast-growing line item. Gartner forecasts worldwide spending on AI agents and assistants will reach $29.2 billion in 2026, up from $16.5 billion in 2025.
Key takeaway: retries, growing context, and exploration are all normal agent behaviour, and any one of them can multiply the cost of a single run.
The simplest cause is a retry. An agent that gets an unusable answer asks the model again. One retry barely registers. A retry loop, where the answer keeps falling short and the agent keeps asking, can turn a five-cent task into a forty-dollar one before anyone notices.
Context adds up more quietly. Each step an agent takes adds to what it sends back to the model: the files it read, the output it produced, the errors it hit. Later steps usually carry what came before them, so long runs tend to get more expensive per step as they go.
Then there's exploration. Asked to fix one bug, an agent might open five files to understand it and ten more to check nothing else depends on the change. That's often exactly what you want from it. It also means two tickets that read the same can involve very different amounts of work.
The ticket won't tell you which kind of run you're about to get. "Fix the date format on the invoice page" could take three steps or thirty.
Key takeaway: a total reviewed after the fact tells you how much you spent and gives you no way to work out why.
AI spend usually shows up as a total from the model provider, looked at after the fact, with nothing linking it to the workflow that spent it. By the time anyone reviews it, the runs behind it finished days or weeks earlier.
Engineering has little chance of explaining it at that point. Nobody remembers which run looped, which workflow's context ballooned, or which repository sent agents off reading half the codebase. Without that link, there's nothing obvious to fix.
Finance is left with a number that jumped last month for reasons nobody can give, and is being asked to approve more of it next quarter. Without a breakdown by team or workflow, AI spend becomes a line item finance has to take on trust, and finance teams don't like doing that for long. In the Flexera 2026 State of ITAM Report, 59% of organizations said wasted AI spend had increased over the past year.
Key takeaway: individual runs will always vary, so predictability has to come from seeing each run's cost as it happens and setting the budget before the spending starts.
The part you can change is how soon you find out, and who sets the ceiling. Buyers are already asking for this: in its latest AI spending forecast, Gartner reports that enterprises want their providers to help them manage costs and build usage tracking into their workflows.
Each token and agent minute needs to be tied to the run and workflow that spent it, so when a number looks off, someone can open the run and see what the agent did. Cost needs to be visible while the run is still going, so an expensive one gets noticed that day, while the people involved still remember the context. And the budget works better as money you set aside up front and draw down, which gives finance a figure to approve before the month starts.
This is how cost works in Upsun Dispatch™. Every run records the agent time it used and an estimate of its token cost, so spend is tied to the workflow that caused it as the work happens. Agent time comes out of credit you top up in advance, and you're notified before the balance runs low. Model tokens are billed by your AI provider directly, with no markup from Upsun. Finance can see spend broken down by workflow and model, and engineering can go down to the individual run to explain an outlier.
Ready to put a number on your AI spend that finance can defend? Read the guide on per-workflow cost
Why does the same AI agent task cost different amounts on different days?
AI agents decide how much work to do while they're running. Retries, growing context, and the number of files an agent chooses to read all change from one run to the next, even when two tasks look alike. Cost depends on how much work the agent does, so it changes too.
What is per-workflow cost attribution?
Every unit of AI spend, whether tokens or agent time, is recorded against the specific run and workflow that used it. Instead of one monthly total, you can see which workflows, teams, and runs drove your costs.
Can you put a limit on AI agent spend?
Partly. In Upsun Dispatch, agent time is paid from credit you fund in advance. When the balance runs out, no new runs start until you top up, which also means no new token spend starts. Runs already in progress are allowed to finish, so the balance can dip slightly below zero, and the next top-up settles it. Model tokens are billed by your AI provider, so your credit balance doesn't cap token spend directly. You also get a notification before your balance runs low.
How can finance budget for AI agents if costs vary run to run?
Set the budget at the level of the total and track spend at the level of the run. Funding AI spend in advance fixes the ceiling for the period. Live attribution by team and workflow shows where that budget is going, so outliers get looked at while they're still fresh.