Blog
How to calculate AI cost per completed task
AI cost per completed task is the delivery cost of finishing one unit of work — not the cost of a single model request. Request-level figures miss the retries, tools, and checks that happen before a task is actually done.
Why cost per request can be misleading
A provider console often shows cost per request: one model call, one token bill. A customer task is rarely one request. A support resolution, a research run, or a document extraction can include several model calls, tool calls, a retry, and an evaluation before anyone would call it complete.
If you price or judge margin from cost per request, you understate how much an AI agent costs per task. The commercial unit is the completed task, or the successful outcome, not the HTTP call that happened to be logged.
Model calls and token consumption
Start with the model calls required to finish the task. Include input and output tokens, and include extra calls for planning, tool selection, or a longer context window.
Record the model or tier when it changes the rate. A short classification call and a long reasoning call should not be averaged together and then treated as “the” model cost without a note.
Tool calls and external API costs
Many tasks call tools: search, a CRM, a payment status API, a browser action, or a third-party enrichment service. Those invoices are part of delivery cost even when they never appear on the model bill.
Attribute tool cost to the task that triggered the call. If one task fans out into several tools, sum them. Leaving tools out makes cheap-looking model tasks expensive in production.
Retries and evaluation costs
Failed attempts still cost money. A retry, a second model pass, or an evaluation that rejects an answer and runs the task again belongs to the completed task — the customer did not pay you for the abandoned try.
Evaluation and guardrail checks are easy to omit because they feel like quality infrastructure. If they run in order to deliver the task, include them in cost per successful AI outcome.
Infrastructure and shared delivery costs
Queues, orchestration, storage, OCR, vector search, and cache infrastructure can be shared across tasks. Include them when your finance policy treats them as delivery cost, using one documented allocation rule.
If you cannot allocate them honestly yet, publish the task cost without them and label the omission. A partial figure is more useful than a precise-looking number that hides the rule.
Calculating total task delivery costs
Add the lines that belong to one completed task:
- Model costs: $0.80
- Tool costs: $0.25
- Retry and evaluation costs: $0.45
Illustrative data, not an actual customer result. Total delivery cost for this synthetic task is $0.80 + $0.25 + $0.45 = $1.50. The customer in the example pays $30 per month.
Comparing task revenue with delivery costs
A single $1.50 task against a $30 monthly fee does not tell you the margin. You need volume. Multiply cost per completed task by the number of tasks in the period, then compare that total with the revenue you attribute to the same work.
In the same synthetic example, 20 completed tasks at $1.50 each produce $30 of delivery cost against $30 of subscription revenue. Delivery cost matches the fee before any other operating expense. At 10 tasks, delivery cost is $15 and gross profit on that fee is $15. At 25 tasks, delivery cost is $37.50, which is above the $30 fee.
If the commercial unit is per-task revenue instead of a monthly fee, compare $1.50 of delivery cost with the price you charge for that completed task. That comparison is the heart of AI customer profitability analysis at task grain.
Identifying potentially unprofitable tasks
A task is a candidate for review when its delivery cost is greater than the revenue you can fairly attach to it, or when a small set of tasks consumes most of a customer’s fee.
Do not stop at the average. The $1.50 figure is one task shape. A document task with extra OCR, or an agent path with more retries, can cost more than a short question on the same plan. Split by workflow before you change price.
The delivery-cost rollup is covered in AI cost-to-serve. How the price structure absorbs that cost is covered in AI agent pricing.
Continue with how those task costs affect AI agent pricing.
FAQ
- Is cost per request the same as cost per completed task?
- No. Cost per request is one model or API call. Cost per completed task adds the calls, tools, retries, and evaluations required to finish the work.
- Should I include failed attempts?
- Yes, when the failure was part of producing the completed task. The customer outcome is what you compare with revenue; the abandoned tries are part of its cost.
- Does this example describe a real customer?
- No. The $30 monthly fee and the $0.80, $0.25, and $0.45 cost lines are synthetic. They illustrate the arithmetic only.