A single response has a relatively visible price. An agent can make several model calls, inspect files, use paid tools, retry failures, and continue working after the first answer. The total cost therefore belongs to the workflow, not just the model named in its settings.

Count successful tasks, not impressive runs

Start with a unit of useful work: one checked research brief, one correctly categorised request, or one accepted document. Define what counts as success before calculating the cost. Otherwise a long run that produces unusable output can appear productive.

Your ledger should include model usage, tool charges, storage or hosting where relevant, and human review time. Keep these categories separate so you can see which part changes when you alter the workflow.

A hypothetical cost example

Suppose a task uses three model calls costing a combined $0.18, a paid lookup costing $0.05, and four minutes of review valued internally at $12 per hour. The review contributes $0.80, bringing the illustrative total to $1.03 before other overhead. These are invented planning numbers, not provider prices.

If only eight of ten runs meet your acceptance criteria, divide the total spent across all ten by eight successful outcomes. Failed attempts do not disappear from the bill. This simple adjustment can change which option looks economical.

Watch repeated context and retries

An agent may repeatedly include a long conversation or large source material. Examine whether every step needs all of it. A compact task state and targeted retrieval can reduce unnecessary work, provided they preserve the facts required for correctness.

Retries also need a reason and a limit. Repeating the same failed action without changing the input is not a recovery strategy. Distinguish a temporary service failure from an invalid request or missing permission, and stop when continuing cannot resolve the problem.

Set limits before unattended work

Use a task budget, maximum duration, and escalation condition where the platform supports them. Explain what the agent should deliver if it reaches a limit: partial findings, completed steps, and unresolved items rather than a fabricated final answer.

Restrict paid or consequential tool actions separately from ordinary reasoning. A cap on model usage does not necessarily cap third-party charges. Check the billing model of every connected service and keep credentials scoped to the required task.

Optimise the expensive part

If review dominates, better validation or a clearer output format may matter more than a cheaper model. If retrieval dominates, narrow the search scope. If the model repeatedly struggles, a stronger model may reduce retries—but test that rather than assuming it.

Anthropic’s multi-agent research write-up illustrates that more capable workflows can involve substantial coordination and resource use. It is a useful reminder, not a universal cost multiplier. Keep a small evaluation set and compare complete outcomes before scaling a workflow to hundreds of runs.

A small cost calculator you can check yourself

Here is a worked extension of the hypothetical example above. Ten attempts cost $10.30 in total when each consumes $0.18 in model calls, $0.05 in tools and four minutes of review valued at $12 an hour. If only eight results meet the acceptance criteria, the cost per accepted result is $1.2875. Dividing by ten would hide the cost of the two failures.

The JavaScript below was checked with these synthetic inputs. It is arithmetic, not a benchmark of an AI provider. Enter the complete model spend for each attempt, including its internal retries; do not add those same retry charges twice. A null result means that no output was accepted, not that the work was free.

// Synthetic USD inputs, not provider prices. Node.js or browser console.
function costPerAcceptedResult(runs) {
  const total = runs.reduce((sum, run) => {
    const amounts = [run.model, run.tools, run.reviewMinutes, run.hourlyRate];
    if (amounts.some(n => !Number.isFinite(n) || n < 0)) {
      throw new Error('Use finite, non-negative costs and durations');
    }
    return sum + run.model + run.tools
      + (run.reviewMinutes / 60) * run.hourlyRate;
  }, 0);
  const accepted = runs.filter(run => run.accepted === true).length;
  return { total, accepted, perAccepted: accepted ? total / accepted : null };
}
const runs = Array.from({ length: 10 }, (_, i) => ({
  model: 0.18, tools: 0.05, reviewMinutes: 4,
  hourlyRate: 12, accepted: i < 8
}));
const result = costPerAcceptedResult(runs);
console.log(result.total.toFixed(2)); // 10.30
console.log(result.perAccepted.toFixed(4)); // 1.2875

Which cost should you optimize first?

In this example, review accounts for $8 of the $10.30 total. Halving the $1.80 model bill saves $0.90, whereas reducing review by one minute per attempt saves $2. That makes review a promising place to investigate, provided the acceptance standard remains unchanged. Less review with more undetected errors is not an improvement.

For a real comparison, fix the acceptance checklist first, include failed attempts in the ledger, and report both cost and accepted-result count. Add setup, storage or monitoring costs separately where relevant. Set a spending and step limit before running a larger batch. Stop the experiment if those limits are reached; do not let an agent decide that another retry is always worth buying.

Synthetic cost example: 10 attempts, 8 accepted results
Cost categoryCalculationTotal USD
Model calls10 × 0.181.80
Tools10 × 0.050.50
Human review40 minutes × 12 / 608.00
All attempts1.80 + 0.50 + 8.0010.30
Per accepted result10.30 / 81.2875