Consider a hypothetical launch forecast for 10,000 AI-assisted production jobs. A spreadsheet multiplies one average request cost by 10,000 and looks complete. It is not yet a budget, because the average hides three different populations:
| Population | What belongs here | Cost question |
|---|---|---|
| Ordinary accepted jobs | The normal path with no unusual expansion | What does the median accepted job cost? |
| Expensive accepted jobs | Long context, extra calls, media variants, or retries | What does the p95 accepted job cost? |
| Failed or abandoned jobs | Paid work that never clears acceptance | How much is spent before failure, and what recovery follows? |
This is the minimum distribution view. The CometAPI estimation guide supplies the input variables: request volume, input and output usage, model choice, context, agent loops, multimodal units, peak load, output caps, task-based prices, sensitivity tests, and pilot usage. The budget becomes useful when those variables are recorded per completed workflow instead of collapsed into one representative call.
Reconstruct the distribution
For each pilot job, write one ledger row:
task class | accepted? | input units | output/media units | model calls | retries | billed cost | recovery class
Then segment before calculating percentiles. A short text extraction and a 30-second video should not share one cost distribution merely because both use an AI API. Keep task classes separate until their acceptance rules and billing units are genuinely comparable.
Within each class, calculate:
- p50 accepted cost: the median cost among accepted jobs;
- p95 accepted cost: the cost that 95 percent of observed accepted jobs did not exceed;
- failure rate: failed jobs divided by all attempted jobs;
- failure spend: billed API cost accumulated by failed jobs;
- acceptance volume: the number of usable outcomes the forecast is expected to deliver.
P50 describes the routine path. P95 exposes the expensive tail. Neither is a maximum, and p95 is unstable when the pilot is too small or unrepresentative. A high-consequence workflow may need a higher percentile and a hard ceiling.
Read the tail as a production signal
Do not add p95 headroom mechanically. First inspect why the tail exists.
A long-prompt tail may call for retrieval limits. A verbose-output tail may need an output cap. A multi-call tail may expose an unbounded agent loop. A media tail may show that several low-resolution drafts precede every accepted final. A retry tail may indicate an unstable route rather than a naturally expensive task.
The action depends on the cause. Some expensive cases are valid work and belong in the price of the feature. Others are control failures that should be removed before launch. Keep both visible so “optimization” does not simply exclude difficult but legitimate jobs.
Price failure separately
A failed job can consume tokens, generated seconds, or image attempts without producing an accepted unit. Preserve that spend even when the request returns no usable result.
Classify the endpoint: invalid output, timeout, provider error, exhausted loop, human rejection, policy stop, or user abandonment. API logs can price the attempts. Human correction, missed deadlines, or downstream disruption may require a separate operational field; when that impact cannot be priced credibly, describe it instead of assigning a decorative dollar value.
The final approval table should contain one row per task class with forecast volume, p50 accepted cost, p95 accepted cost, failure rate, failure spend, hard per-job limit, and the observation date. Refresh the row when prompts, retrieval, model routes, tools, or acceptance rules change.
A launch forecast is decision-ready when ordinary work, expensive valid work, and failed work each have an owner, a measured range, and a control. That table—not one blended average—is the budget finance and production can approve.