The short answer
An AI agent's cost per task is the tokens it reads times the model's input price, plus the tokens it writes times its output price, added up over every step the task takes. A token is a piece of a word. A short answer from a small model costs a fraction of a cent, while a long investigation with many tool calls on a large model costs many times more. You can estimate it beforehand and read it back afterwards.
The formula
Cost = tokens in × the model's input price + tokens out × its output price. Prices are quoted per million tokens and differ a lot between models, and output usually costs several times more than input. As a rule of thumb a token is about four characters of English, or three-quarters of a word. Dutch, German and code tend to need more tokens for the same meaning.
An AI agent rarely answers in one go. It reads, calls a tool, reads the result and decides again. Each of those steps is a model call with its own tokens in and out, so the cost of a task is the sum over its steps. In Infinized the price list is configured per model, and a run on a model without a listed price is costed at zero, which is worth knowing if you add a model yourself.
A worked example
A 40-person webshop wants a colleague to handle "where is my order?" tickets: read the ticket, look up the order, check the delivery policy and draft a reply for a person to approve. Take an illustrative mid-sized model at $3 per million input tokens and $15 per million output tokens.
| Step | What the colleague does | Tokens in | Tokens out |
|---|---|---|---|
| 1 | Reads its instructions, the knowledge passages and the ticket, and asks for the order | 5,000 | 150 |
| 2 | Reads the order and its tracking, and searches the policy | 6,500 | 150 |
| 3 | Reads the policy article and drafts the reply | 8,000 | 450 |
| 4 | Checks the draft and proposes it for approval | 8,500 | 400 |
| Total | 28,000 | 1,150 |
Input: 28,000 tokens at $3 per million is $0.084. Output: 1,150 tokens at $15 per million is about $0.017. The ticket costs about $0.10, and 1,500 tickets a month about $150.
Two things stand out. Input is more than 80 per cent of the cost, even though it is the cheaper side, because every step reads everything that came before it. And the same four steps on an efficient model priced at $0.40 and $2.00 would cost about $0.014 a ticket, around $20 a month, provided its drafts pass the same checks.
What drives it up
- Context. Everything a colleague reads on each step counts as input: its instructions, the knowledge passages, memories, the conversation and every tool result. Long tool results are the usual culprit.
- Steps. Each step reads the context again, so a task that takes eight steps costs far more than one that takes two.
- The model. A flagship model can cost many times what a small one does for the same work.
- Reasoning. Reasoning models think in tokens that are billed as output, and a higher reasoning effort lets a colleague take more steps per turn.
- Failures. A failed attempt still used tokens, and it is recorded as a run of its own.
How to bring it down
- Match the model to the work. Every colleague has its own model, so sorting and routing can run on an efficient one while judgement stays on a stronger one. See which model each colleague should use.
- Keep tool results short. Ask for the fields you need, not the whole record. A list of fifty orders is read again on every step after it arrives.
- Cut steps with clear instructions. Tell a colleague what to look up first and when to stop. Work that always follows the same path can be a flow with fixed steps.
- Put a ceiling on a chain. A flow has a cost ceiling per run, and a delegated chain can have one too, so one runaway task cannot spend the month.
- Tidy the knowledge. Infinized adds a bounded set of the most relevant passages to a step, not whole documents, so a bigger help centre does not make every step dearer. Duplicate and outdated articles still take up that space.
Estimating before you start
Take ten representative tasks, including a few awkward ones, run each a few times and read the cost of the runs. Use the typical figure for planning, and look at the expensive tail: that is where the long tool results and the extra steps are. Multiply by the volume you expect and leave room for retries.
Then set a monthly budget a little above it: the estimate tells you what to expect, and the cap stops runs if you pass it. For a colleague with no history yet, the cost overview shows an expected cost per run at a typical footprint for its model. Treat that as a starting point, not a measurement.
How Infinized records it
Every run records its model, tokens in and out and an estimated cost. A task's page totals the runs of that task, and the subtasks it delegated keep their own totals. Costs roll up per colleague, per team and per model, with a daily trend and a month-end forecast, and a day that spends three times the average of the week before is flagged to the owners.
The forecast also shows whether the budget will run out before the month ends at the current pace, and the most expensive tasks of the period are listed, so you know where to look first. Helper calls with no colleague behind them, such as summarising a long conversation, choosing who answers in a channel or embedding a knowledge source, are recorded as runs too and count towards the budget. The same figures are available through the API.
Run receipt · 14:10:31Succeeded
- Provider · model
- Anthropic · claude-sonnet-5
- Tokens in / out
- 3,412 / 286
- Estimated cost
- $0.0097
- Duration
- 2.1 s
- Served
- Task · ticket #20417
Tool calls
- 1
zendesk_get_ticket#20417 · “Invoice paid twice” - 2
search_knowledge3 passages · Refund policy - 3
create_subtask“Check the payment” → Otis
Task total $0.0220Subtask, its own total: $0.0003
Estimate versus invoice
The figure is an estimate from list prices. Your provider's invoice is the authority, and with BYOK, on your own keys, it is billed to you directly. When an AI agent's own provider is not connected and its work goes to another, the run is priced on the model that actually answered.
Details the estimate does not model, such as a discount for cached input or a price change at the provider, make the two drift apart. Compare them once a month, per model, and adjust the budget rather than the expectation.