Cost · · 4 min read · Updated
Estimate an agent job before you approve a larger batch
Estimate a larger agent batch using representative task groups, correctly priced usage, review labor, failed attempts, and an allowance for difficult cases.
A leader approves a sample of ten account reviews. The results look useful, and someone asks to process the remaining ten thousand. Multiplying the sample invoice by one thousand misses document length, retry behavior, review labor, and the accounts the sample excluded.
Estimate the batch from its parts and show a range. Three decisions come first:
- Does the sample represent the queue?
- Have the usage fields been interpreted correctly?
- How much failed or abandoned work belongs in the cost of an accepted result?
A practitioner asked whether OpenAI input usage includes cached tokens. Counting total input and then adding cached input again double-counts part of consumption. Check the provider's field definitions before building the spreadsheet.
Start with a task envelope#
Define what the estimate includes. For an account review, specify source systems, maximum document volume, required output, review step, and whether the agent writes back to the customer system. A read-only brief and a completed account update are different jobs.
Split the backlog into useful groups. Document count, language, missing information, and account exceptions explain cost better than customer size. Keep an unknown group for unclassified items, because giving unknown work the cheapest rate manufactures confidence.
In a hypothetical batch, 800 standard records take one pass and 200 complex records take two. Suppose measured model and tool cost is $0.60 for a standard item and $2.40 for a complex one. The baseline is $960. If 10% of items each need one complete repeat at the same average mix, add $96. Labor and fixed setup are still excluded.
Price each meter once#
Match the calculation to the provider, model, and execution mode. Input, cached input, output, hosted tools, storage, and external API charges use different units. Keep the rate date and currency with the estimate, and do not mix a discounted batch rate with interactive usage.
The OpenAI Agents SDK usage documentation describes usage collection across requests. It supplies accounting inputs and does not define completed work, so join them to your own task identifier and acceptance decision.
| Cost line | Measurement | Common omission |
|---|---|---|
| Model requests | Provider usage by billing category | Hidden work inside repeated attempts |
| Paid tools | Chargeable calls or sessions | Search, compute, or external API fees |
| Review | Minutes per accepted result | Escalations to a senior reviewer |
| Failures | Cost of unsuccessful attempts | Items discarded before acceptance |
| Setup | One-time integration and testing | Treating setup as free labor |
For the hypothetical batch, two minutes of review per item adds 33 hours and 20 minutes. If difficult records take ten minutes to review, use a separate review rate for each group instead of the standard-item average.
Test the expensive tail#
Choose a handful of the longest, least complete, and most contradictory records. A random sample can contain none of the cases that dominate the total bill. Record why each stress case was selected and keep its result separate from the representative sample.
Price the longest, messiest records first, because they set the bill.
Check what stops a task that keeps trying. Without an enforced limit, a mean observed cost is not an estimate of maximum exposure. Decide whether the batch pauses after repeated failure, hands an incomplete item to a human, or moves it to a separate queue, and price that fallback too.
Some failures occur after an external action succeeds and before the agent receives confirmation, and repeating the task can duplicate the action. Separate a safe retry from a reconciliation task that first checks the destination. Cheap blind retries create expensive cleanup.
Make the approval request usable#
Present three figures: expected cost, stress-case cost, and the enforced amount at which new work stops or requires another decision. The last figure counts only if the execution path enforces it; an alert threshold alone gives less control.
Use cost per finished task for the acceptance denominator and spend reconciliation after the batch. Compare estimated and actual cost by group.