← All articles

Measure workflow results and costs

How to Find What Is Driving Up an AI Workflow’s Token Bill

Calculate cost per completed AI task, trace token growth to specific calls, and test savings against the quality of accepted outputs.

By Niko Minadze5 min read

Editorial illustration for How to Find What Is Driving Up an AI Workflow’s Token Bill

If an API-based AI workflow bill is rising, start by pricing one completed task, not one model call. Add the input and output charges for every call needed to finish that task, including tool-assisted steps and retries. Then compare that estimate with measured usage. The increase may come from more tasks, more tokens per task, a different model mix or attempts that never produce an accepted result. A lower token rate helps only if the full task still costs less and meets the required quality standard.

Price the whole completed task

Define the unit before opening a usage report. For a support-ticket summary workflow, one unit might be a summary accepted for use by the support team. Its cost includes the calls that gather or process ticket context, draft the summary and retry a failed attempt. Keep unsuccessful attempts visible even when no summary is accepted.

For each call, calculate:

(input tokens × applicable input rate) + (output tokens × applicable output rate)

If rates are quoted per million tokens, divide each token count by one million before multiplying. Sum the calls for the task, then multiply by expected task volume for a starting forecast. Use the rates and billing rules for the actual models and contract. Confirm whether separate charges, discounts or reasoning-token rules change the calculation before treating it as a spending forecast. A 2025 discussion of agent costs describes reasoning tokens as billed as output for the GPT-5 lineup it discusses; that is not a rule to assume for every model or agreement.

A hypothetical ticket-summary estimate

Suppose a workflow makes two calls per ticket. The first prepares a draft from the ticket and retrieved material; the second produces the summary intended for review. This is a teaching example, not an observed bill or a current provider price.

Call Input tokens Output tokens Cost at illustrative rates
Draft 3,500 500 $0.0110
Final summary 2,500 300 $0.0074
Completed task 6,000 800 $0.0184

The example uses $2 per million input tokens and $8 per million output tokens. Input costs $0.0120 per task, and output costs $0.0064. At 20,000 completed tasks, the estimate is $368, before retries or other applicable charges.

Perhaps the second call receives passages already supplied to the first. That repeated retrieval material is worth inspecting, but the totals alone do not prove it caused a bill increase. You need call-level records and a comparison period to establish whether it grew.

Locate the increase in measured usage

Record a task ID, model, calls and turns, input and output tokens per call, retries, and whether the task reached an accepted summary. Associate failed attempts with their task when possible. Otherwise, an apparently cheap completed call can conceal the work spent getting to it.

Compare two periods in this order:

  1. Completed-task volume: Did the team process more tickets at roughly the same cost per task?
  2. Tokens per task: At similar volume, did input or output tokens rise? Compare distributions as well as averages so unusually large tickets do not disappear into a single number.
  3. Calls and unsuccessful attempts: Did turns, retries or abandoned attempts increase? Price their consumed tokens too.
  4. Model mix: Did more tasks move to a model with different applicable rates, or did that model use a different number of tokens or calls?

For growing inputs, inspect lengthy instructions and tool manifests, repeated retrieved documents, and context resent between agent steps. These are plausible mechanisms, not a diagnosis without your records. The agent-workflow cost discussion identifies verbose setup material and repeated retrieval payloads as sources of input-token growth, and notes that handoffs can resend context. Available usage breakdowns and the treatment of reasoning tokens depend on the model and contract, so reconcile the detail you can measure with the billing detail you actually receive.

Test a control without losing the summary

Change one thing at a time on a representative set of tickets. Remove redundant instructions, retrieve only the passages needed for the ticket, cap turns or retries, or compare another model on the same tasks. If delayed results are acceptable, batch processing is another candidate only where the provider offers suitable terms. A ZDNET discussion of API costs describes lower-priced batch processing with slower results, but that does not establish its availability or price for your contract.

Recalculate all calls per accepted summary after each change. A lower-rate model might generate longer answers, need extra attempts or create more corrections. A stricter retry limit might lower token use while leaving more tickets unfinished. Neither is a saving if the required result becomes more costly to obtain.

Have a reviewer check whether each summary retains the ticket’s key issue, relevant policy detail and escalation flag. Record omissions, corrections and failed attempts beside token cost per accepted summary. Keep a change only if that cost falls without losing required information or shifting the expense into corrections and retries. This is a narrow cost-and-quality check; for a broader review-effort comparison, see How to Tell Whether an AI Workflow Saves Time After Review.

Finally, reconcile the projected task count and token charges with billed usage and any applicable billing adjustments. Set a monitoring threshold for changes in task volume or tokens per task, and investigate when it is crossed. That gives the next bill an explanation to test, rather than merely a number to worry about.

← All articles