Inveniq
All articles

What an AI agent actually costs in production

Cost

The first invoice surprises most teams. Not because the price per is high, but because the intuition is wrong: a SaaS product costs more when more people use it, an agent costs more every time it thinks one more round.

The cost is in the context, not in the answer

An is a loop: task, tool call, result, reconsider. The surprising part is that every turn resends the entire . The model remembers nothing between calls, so the , the tool definitions and all prior history go along each time.

Agent loop where the tool response is appended to the contextCONTEXTSystem prompt + toolsHistorygrows every turnsent inModelcallsToolresponse is appended to the history
The loop. The tool response is appended to the history, and the whole context goes back in on the next turn. That return arrow is the cost.
TurnFixed contextHistorySent in
13,0005003,500
23,0001,2004,200
33,0002,0005,000
43,0002,8005,800
Total12,0006,50018,500

One request, 4 turns, tokens per turn. Note the total row: 12,000 of the 18,500 tokens are the same system prompt sent 4 times.

So an agent taking 6 turns does not cost 6 times one turn. It costs the sum of a growing context, dominated by tokens going in rather than the answer coming out.

Run the numbers

Put your own figures in, the structure holds. A support tool with 20,000 requests a month, 4 turns each, and a fixed 3,000 token system prompt.

Roughly 18,500 tokens in per request against 1,200 out. Scaled up: 370 million tokens in per month, of which the fixed 3,000 alone account for 240 million. Close to two thirds of the bill, before the agent has done anything useful.

Close to two thirds of the bill was the same system prompt, sent again.

What that is in money

370 million tokens in and 24 million out per month. Same calls, same system, same task. The only thing that changes down the table is which model you point at.

Running everything onInOutPer month
Frontier$1,850$600$2,450
Mid-tier$740$288$1,028
Small$52$7$59

Prices retrieved 7 August 2026 for the three tiers described in the pricing article. The difference between the top and bottom row is 41 times, on a system doing exactly the same work.

Same system, same task, same number of calls. $2,450 or $59.

The point is not that you should run everything on the bottom row. It is that nobody should run everything on one row. Put the trivial steps at the bottom and keep the frontier where it is genuinely needed, and the bill lands near the floor while quality stays at the ceiling where it matters.

The spread between models is wider than people think

A review of frontier pricing in July 2026 found a 643x gap between the most and least expensive price per million output tokens, across models you call with nearly identical requests. Same task, same arithmetic above, and an entirely different final number depending on what you point it at. We have written more about how the prices move in The price of AI is collapsing.

The large model is rarely the right default. An agent loop has a few demanding steps and many trivial ones, and the trivial ones are most of the volume.

4 things that work

Pick the model per step, not per system

The routing does not need to be clever, just a table from step type to model size. The gain comes from moving the volume off the expensive model.

Step in the loopShare of volumeDifficultyModel
Classify the requestHighLowSmall
Extract a fieldHighLowSmall
Summarise a tool responseMediumMediumMedium
Plan the next stepLowHighLarge
Write the replyMediumMediumMedium

Note where the large model sits: on the single step with low volume. That is where it earns its price.

what does not change

The system prompt is identical on every call and sits first in the context. Most providers offer caching for exactly that part. In the arithmetic above it is the single line item that matters most.

Cap the history

An agent left to run freely will sometimes spend 20 turns on something it cannot do. A hard cap on turns cuts the tail where cost runs away.

Measure cost per run, not per month

A monthly total tells you nothing about where the money goes. Log tokens and model per step, aggregate by task type, and you will see which 5 percent of requests account for half the bill.

This connects to evaluation

All of it depends on answering one question: did it get worse? Switching model without being able to measure quality is not cost control, it is guessing.

4 min readLast updated

The goal is a business better equipped to make decisions

Not just solving today's challenges, but making the business better equipped to make decisions in a technology landscape that changes faster than ever. That's what we build.

Get in touch