Cost planning
AI Automation Cost Model: Cost per Successful Workflow
Do not compare AI workflows by token price alone. Divide the full operating cost—models, tools, retries, infrastructure, review, failures, and maintenance—by the number of outcomes users actually accept.
How this guide was produced
Original total-cost formula using provider-neutral variables. Provider prices are intentionally not copied into the article because they change; readers must use the linked current pricing pages.
AI assisted with research organization and editing. It is not treated as a source. Product capabilities and prices can change; verify the linked primary sources before making a purchase or production decision.
The formula
Cost per accepted outcome = total workflow operating cost ÷ accepted outcomes.
Total operating cost includes model input and output, tool calls, retries, infrastructure, human review, failure consequences, and maintenance. Accepted outcomes exclude runs that were abandoned, rejected, duplicated, or corrected from scratch.
Cost components
| Component | Calculation | Include |
|---|---|---|
| Model input | Input tokens × current input rate | Prompts, retrieved context, tool results, history |
| Model output | Output tokens × current output rate | Responses, plans, structured data, generated artifacts |
| Tools | Per-call fee + compute + data transfer | Search, browser, code, databases, SaaS APIs |
| Retries | Failed-attempt cost × average attempts | Model retries, tool retries, recovery and duplicate work |
| Infrastructure | Monthly runtime and storage ÷ accepted outcomes | Queues, databases, vectors, sandboxes, logs, tracing |
| Human review | Review minutes × loaded labor rate | Approval, correction, exception handling, quality sampling |
| Failure loss | Failure probability × average consequence | Rework, support, refunds, incorrect actions, downtime |
| Maintenance | Monthly engineering cost ÷ accepted outcomes | Prompt, model, tool, test, and policy updates |
Provider-neutral worksheet
- Measure average input and output tokens for one attempt by model and step.
- Record tool calls and their direct or infrastructure cost.
- Measure the distribution of attempts per task, not just a configured retry limit.
- Allocate monthly infrastructure, telemetry, storage, and maintenance across completed tasks.
- Measure review minutes for ordinary results and exceptions separately.
- Count accepted outcomes using a defined review or business signal.
- Model failure consequence separately from normal correction time.
Use current provider prices at calculation time. The linked OpenAI, Anthropic, and Google pricing pages change independently, and model names or caching rules may change faster than this guide.
Worked example with hypothetical rates
The following numbers illustrate the method and are not current provider prices. Suppose a document workflow handles 1,000 tasks per month:
- Model and tool cost across all attempts: $180.
- Infrastructure, logs, and storage: $120.
- Human review: 40 hours at a loaded rate of $30 per hour, or $1,200.
- Maintenance allocation: $500.
- Failure and rework allocation: $300.
- Total operating cost: $2,300.
- Accepted outcomes: 850.
The cost per accepted outcome is $2,300 ÷ 850 = approximately $2.71. Dividing only the $180 model and tool bill by 1,000 requests would report $0.18 and understate the operating cost by more than an order of magnitude.
Compare with the current process
Calculate the manual baseline using the same outcome definition. Include labor, waiting time, rework, software, supervision, and the cost of current errors. Automation is economically useful when it improves the combination of cost, speed, quality, and capacity—not merely when the model line item is cheap.
A workflow may cost more per task but still be valuable if it reduces turnaround from days to minutes or enables work that was previously impossible. State that value explicitly rather than hiding it inside an assumed “ROI” percentage.
Set budgets at three levels
- Per attempt: cap tokens, tool calls, and execution time.
- Per task: cap attempts, total spend, and review escalation.
- Per period: cap daily or monthly spend and alert on changes in volume, token mix, tool use, failure rate, and accepted-outcome rate.
Metrics that explain cost changes
Track model, operation, input tokens, output tokens, cached tokens when available, tool name, tool duration, retries, task outcome, review time, and trace ID. OpenTelemetry’s generative AI semantic conventions provide a useful direction for consistent operation and usage telemetry, but teams should review data sensitivity before recording prompts or outputs.
Run sensitivity cases before setting the budget
A single average hides the conditions most likely to break the business case. Calculate at least three scenarios. The expected case uses observed task mix and review time. The stress case increases tool failures, long-context tasks, and manual escalation. The growth case increases volume and includes any stepwise infrastructure, rate-limit, or staffing cost. Keep provider rates as dated inputs so the same worksheet can be rerun without rewriting the formula.
Also vary the accepted-outcome rate. If acceptance falls from 90% to 70%, the same monthly spend is divided across fewer useful results while rework may rise. This sensitivity is often more important than a modest token-price difference. Set an alert on outcome rate, retry rate, and review minutes so the team notices when the original cost assumption stops describing production.
Cost reduction order
- Remove unnecessary agent steps and repeated context.
- Fix the failure causing retries before changing models.
- Route simple steps to a smaller or cheaper model only after evaluation.
- Cache stable context where the provider and privacy requirements permit it.
- Use batch or asynchronous processing when latency is not important.
- Reduce human review through better acceptance tests—not by silently accepting more risk.
- Archive or sample traces according to incident and audit needs.
Worked scenario without frozen provider prices
Suppose a workflow receives 10,000 valid requests in a month. Record measured average uncached input, cached input, output, tool calls, retries, and completion for the deployed configuration. Multiply usage by a dated rate table from the provider account. Add workflow infrastructure, observability, storage, review hours, correction hours, and allocated support. Do not copy a headline model price and call the result total cost.
If 8,800 runs complete, 8,100 pass external validation, 500 require repair, and 200 are abandoned or unresolved, the denominator for a strict accepted-outcome calculation is 8,100 unless the repaired cases later pass and their repair cost is included. Report completion and acceptance separately. Otherwise a system can appear cheaper by returning more low-quality results.
Create at least three scenarios. The low case may use shorter inputs, strong cache reuse, stable integrations, and little review. The expected case uses measured medians and current acceptance. The high case increases output, difficult-task share, tool errors, fallback, tail latency, and review. Display which variables drive the range instead of presenting one precise forecast.
Allocate shared and fixed costs
Shared evaluation, platform, security, and observability work can be allocated by usage, workflow count, or expected benefit; choose and disclose a method. Reserved capacity and owned hardware need realistic utilization and idle cost. Development cost may be amortized over an expected life, while recurring maintenance remains operating cost.
Separate pilot economics from steady state. A pilot includes setup and learning that may not repeat, but it often underestimates support, compliance, incident, and refresh costs that appear at scale. Record both views so a temporary experiment is not presented as a mature production forecast.
Connect budgets to controls
Set per-run ceilings for tokens, steps, tool calls, elapsed time, retries, and spend. Set daily or monthly limits by workflow, customer, and environment. A ceiling should stop with structured state and an escalation path; silently truncating an answer or abandoning an external transaction can convert cost control into a quality or security failure.
Alert on cost per accepted outcome, not only total spend. Segment by task because a changing traffic mix can raise average cost even when each route is stable. Investigate falling acceptance, rising retries, longer output, cache misses, fallback growth, tool fees, and human correction before negotiating a cheaper token rate.
Recalculate after material change
Trigger review after model, prompt, context, tool, price, service tier, traffic, acceptance rule, reviewer policy, integration reliability, or deployment architecture changes. Preserve the old evaluation set and cost assumptions so the new estimate is comparable. A lower bill with a lower acceptance rate is not automatically an improvement.
Assign one owner to reconcile usage, billing, and outcome data. Differences can reveal delayed invoices, untracked retries, missing tool charges, or accepted outcomes that were never recorded. Record the reconciliation period and unresolved variance instead of forcing the forecast to match an incomplete dashboard.
Limitations
This model is a planning framework, not financial advice or a live pricing calculator. Taxes, regional pricing, enterprise agreements, currency conversion, rate limits, and provider-specific tools may materially change the result. Recalculate after changing model, prompt, context size, workflow, tools, review policy, or traffic mix.
Next steps
Confirm the process is suitable with the readiness checklist. Use the security checklist to set tool and retry boundaries. Select the simplest architecture with RAG vs agents, then compare implementation options in the AI tools hub.
Primary sources
Sources were checked on . Follow the links for current product details.
- OpenAI API pricing
Current model and platform pricing; verify immediately before calculation.
- Anthropic Claude platform pricing
Current token, caching, batch, and tool-related pricing information.
- Google Cloud generative AI pricing
Current Google Cloud model and agent platform pricing information.
- OpenTelemetry generative AI semantic conventions
Telemetry conventions for recording generative AI operations and usage.
- OpenAI Agents SDK usage
Official per-run and per-request usage fields for monitoring model consumption.