An agent can spend little on a request and leave half an hour of corrections. It can also consume more and produce something needing few changes. Comparing those outcomes starts with defining a finished task.
We suggest using an accepted result as the unit. A report whose main source cannot be checked still needs work. An export containing duplicate rows is not finished merely because a file exists. Write the acceptance criteria before estimating costs.
Keep cost categories separate
Distinguish model usage, external tools, infrastructure and human review. A paid search or image-processing action may be billed separately from text. For subscriptions, record the fee and what the product exposes rather than inventing an undisclosed per-task price.
For token-priced APIs, use actual billed quantities and the applicable rate for each category. Input, output and reused input may be treated differently. OpenAI’s prompt-caching documentation describes prefix reuse; do not assume all context always qualifies.
The basic calculation sums each quantity multiplied by its unit price, then adds other costs. Keep currency and period consistent. Combining a monthly euro invoice with dollar usage without explaining conversion creates misleading precision.
A deliberately hypothetical worked example
Suppose a task uses 100,000 input and 20,000 output tokens. To illustrate the calculation, assume rates of $2 and $20 per million respectively. These are invented teaching assumptions, not a provider’s prices or a model recommendation.
Input would cost $0.20 and output $0.40. Adding $0.04 for tools produces $0.64 in direct usage. Thirty minutes of review, valued at an assumed $25 per hour, brings the allocated total to $13.14.
The example shows which category dominates under those assumptions. It does not establish that every agent is inexpensive or that review always takes thirty minutes. Replace the quantities with your own records before making a decision.
Make retries visible
Repeating the example’s direct usage once, while keeping total review at thirty minutes, produces $1.28 in usage and $13.78 overall. Additional review time must be added separately.
Not every failure requires repeating an entire request. Correcting the output or restoring access may be enough. Before resending an operation that charges money or writes data, establish whether the first attempt completed. A lost network response does not prove that an operation was free or never happened.
Keep the identifier, status and observed cost of every attempt. When the result is uncertain, leave it pending until reconciled. Deleting it only makes the budget look better.
Calculate cost per accepted result
Across comparable tasks, add the cost of every attempt, including failures, and divide by the number of accepted results. With no accepted results, you do not have a useful cost per success. Improve the process before extrapolating.
Report acceptance rate and the criteria alongside that figure. Removing checks may reduce apparent cost while allowing worse results through. Changing the definition of success during the comparison also undermines it.
Separate simple and complex work. A short summary and a software migration are not equivalent units just because both appear as runs in a history log.
Budget with explicit limits
Start with a small sample, retain results and decide on a spending ceiling before automating. Define what happens at the ceiling: stop, request review or reduce the scope of future tasks.
Separate subscription spending from other cost categories with our guide to choosing between Claude Pro and ChatGPT Plus.
For coding work, define the task using the criteria in our Claude Code and Codex comparison.
Our cost calculator can help explore scenarios, but the calculation still needs appropriate inputs and assumptions. To measure a real process before expanding it, tell us what result you need.