How to Estimate the Cost of an AI Agent Workflow
An AI agent's cost is the cost of the complete workflow you deliver, not just one model call. A workflow may include several model calls, tool calls, compute, retries and human review. Count the parts that apply to your product, then keep assumptions visible.
There is no universal cost per task. The result depends on the workflow, configuration, usage and prices you actually pay. Avoid using a headline benchmark as a substitute for measuring your own runs.
Build a cost per attempted action
For each representative attempt, record the costs that apply:
- Model input and output, including repeated calls.
- Paid tools, external APIs and compute.
- Retries and failed attempts that consumed resources.
- Human review or support when it is part of delivery.
Then calculate a monthly cost estimate:
monthly modeled cost = cost per attempted action × monthly attempts
+ other monthly customer cost
Keep failed attempts in the cost total even if customers pay only for successful outcomes. If success rate is p and each attempt costs C, a simple estimate of cost per success is C / p, assuming attempts have similar cost. For variable workflows, use paired run data instead of this simplified formula.
Compare billing units with the same assumptions
Here is an illustrative example, not a provider price or customer result. Assume one attempted action costs €0.30, other monthly cost per customer is €5, and a customer makes 60 attempts. Modeled cost is €23.
- A €49 fixed plan leaves €26 contribution, or 53.1% margin on those included costs.
- At €0.96 per attempt, revenue is €57.60 and modeled margin is 60.1%.
- A €19 plan including 20 attempts with €0.96 per additional attempt produces €57.40 revenue and about 59.9% margin.
These examples do not establish willingness to pay. They leave out any cost not listed, such as payment fees, taxes, refunds, fixed company overhead and acquisition. Define what counts as a billable attempt and explain how customers can monitor or cap usage.
For the formulas and additional usage levels, see the AI agent pricing calculator, the guide to fixed, per-action and credit pricing, and the worked guides to credit allowances and heavy-user margin exposure.
Treat credits as a unit conversion
If an action uses 12 credits and the plan includes 1,440 credits, the balance covers 120 whole actions. Credits can make packaging clearer, but changing the credit denomination does not reduce execution cost. The allowance, overage and treatment of retries still need to reflect the workflow's cost and customer expectations.
A cost-based overage floor for target margin m, action cost C and k credits per action is:
revenue per credit ≥ C / ((1 − m) × k)
This is a floor on the stated marginal cost. Other variable costs may raise it. It is not a market price recommendation.
Measure before you optimize
Use representative attempts and record full-attempt cost, outcome, retries and workflow version. Track mean and median for typical usage, and inspect high-cost runs separately. A small sample's p95 is unstable; an attempt-cost percentile also does not equal cost per successful outcome.
Recalculate after changes to models, prompts, tools or retry behavior. Compare actual light, typical and heavy usage with the allowance customers see. Use interviews and offer tests to learn willingness to pay; the cost model alone cannot answer that question.
All euro amounts and rates above are illustrative assumptions for showing the arithmetic. They are not live provider rates, observed customer data, financial advice or a validated offer.
Check what happens during recovery
Retries affect both cost and external actions. Our Agent Evals guide to turning a failure into a regression test includes a CRM timeout example and a downloadable test-case template. Use the service’s mutation ledger to check for duplicate writes, alongside your workflow cost measurements.