Measure AI feature cost against a defined completed task. Token spend alone misses failed attempts, repeated tool calls, retrieval, storage and the operating work needed to support the feature. A cheaper response is not an improvement if it causes more retries or leaves the user unable to finish.
Define completion before calculating a unit cost
For a proposed coaching assistant, completion might mean producing a permitted program preview that passes validation. It is not simply a model returning text. Track attempts, completed tasks and rejected or abandoned work separately. If the feature can change records, distinguish previewing an action from committing it.
| Input for one test period | Example value | Purpose |
|---|---|---|
| Total variable model and tool expense | $120 | Include unsuccessful attempts and retries |
| Completed eligible tasks | 600 | Use the agreed completion condition |
| Variable expense per completed task | $0.20 | 120 divided by 600 |
| Additional operating expense | $80 | Track separately; define how it is allocated |
| Allocated total per completed task | $0.33 approximately | 200 divided by 600, under this allocation |
Find the expensive failure path
Break the workflow into retrieval, model calls, tool execution and validation. Record durations and usage against a request identifier without logging unnecessary private content. A fallback model or retry can improve completion, but its cost belongs in the same task. Compare like-for-like cohorts and supported scenarios before deciding an optimization worked.
Change one mechanism, then check quality
- Collect a representative set of allowed tasks and important failure cases.
- Measure baseline completion, validation failures, latency and usage.
- Change one mechanism such as context size, caching or model routing.
- Run the same acceptance set and inspect failure behavior.
- Compare expense per completed task rather than price per individual response.
Caching needs an identity and freshness policy. A cached answer containing one client’s private context must not be served to another account. Smaller context also has a tradeoff: removing the required record or policy can reduce apparent cost while making the answer wrong. Tie savings to the feature’s evaluation criteria.
Budget without relying on temporary credits
Promotional credits can reduce the cash paid during a test period, but they do not establish a sustainable marginal cost. Keep the underlying usage expense and the amount offset by credits separate. Recalculate at the supported provider prices, account terms and expected workload before extrapolating.
Estimate the engineering work separately from model usage
Evaluate AI agents on the task and failure cases
AI SaaS margins with and without cloud credits
Is a lower token bill proof that an AI feature is more efficient?
No. Compare the same task and quality requirements, including retries, failures and tool costs. Fewer tokens can still produce fewer completed tasks.
Should cloud credits reduce the reported underlying unit cost?
Keep the underlying expense and the promotional offset separate. Credits affect cash paid while they apply; they do not show what the workload costs after expiry.
