Guide · Retries and fallbacks

Retries and fallbacks: counting the real cost of an AI task

Most production AI workloads do not make one call per task. A request times out and is retried, an output fails validation and is asked for again, or a cheaper model gives up and the work falls back to a stronger one. Every one of those attempts can be billed. A price per request describes one attempt; what your team pays for is the finished task.

A retry is a separate request

Count each model call as its own request, including retries, validation re-asks and fallback calls. A task is the unit of work you care about, which may take several requests. If your logs record only the final call, or only successful calls, the cost of the attempts that came before it disappears from your figures.

Where retry and fallback cost hides

A worked example, on synthetic data

One hundred tasks run through a fallback policy: try model-a1; if it fails, retry once on model-a1; if that fails, make one call to model-b1. All figures are synthetic, the models are fictitious, and the prices are illustrative: $0.004 per call on model-a1 and $0.020 per call on model-b1.

Synthetic example: 100 tasks through one retry and one fallback
StepCallsTasks completedCost
model-a1, first attempt10060$0.400
model-a1, retry4015$0.160
model-b1, fallback2522$0.500
Whole policy16597 of 100$1.060

The whole policy costs $1.060 ÷ 97 = $0.0109 per completed task, about 2.7 times model-a1’s price per call. Split by model, model-a1 shows $0.560 ÷ 75 = $0.0075 per successful request and model-b1 $0.500 ÷ 22 = $0.0227. Neither row is the cost of the policy, and three tasks were never completed at all.

For comparison, sending every task to model-b1 with one retry (100 + 8 calls, 98 of 100 tasks completed, again synthetic) costs $2.160 ÷ 98 = $0.0220 per completed task. Which policy is better for a real workload depends on its own success rates, prices and how much an uncompleted task matters; the point of the example is that only the per-task figure lets you compare them.

How to log attempts so the cost is countable

With that, you can produce one row per whole task: the total cost of all its requests and its final outcome. That is the input a cost-per-completed-task comparison needs.

What AIYVO does today, and what is planned

Today, AIYVO is an offline analyzer that reads usage exports you already have, on your machine. It treats a retry as a separate request. When your mapping declares one row per whole task (row_kind: "task"), it reports cost per completed task, counting failures in cost; it does not check that your task rows add up their requests correctly. When rows are requests, it reports cost per successful request and withholds task-level figures, noting that the cost of a completed task can be far higher. It does not call providers and does not verify provider billing. Routing between models and spend governance are planned, not available; the planned-platform simulation shows how they are intended to work, on synthetic data. See also why the cheapest LLM per request can cost more per result.

See it on a worked example

The AIYVO analyzer runs offline on a usage export you already have. On this site it is shown step by step on a synthetic export with fictitious models, so you can inspect every input, command and output.

Counting retries on one real workload? Read how an AIYVO pilot works or send a pilot-interest inquiry to jorge@aiyvo.com. It creates no account, subscription or commitment, and does not guarantee a pilot.