$180 in AI Spend, Split Across Three SaaS Features
01 / The $180 receipt your API dashboard cannot explain
A small SaaS does not need a finance platform to answer a basic question: which feature spent the money? It needs a ledger that connects each billable API request to a customer action.
Consider a hypothetical writing app with three AI features: draft generation, document summaries and automatic tagging. The monthly AI bill is $180. All amounts and volumes below are illustrative accounting inputs, not CheapRelay prices, measured benchmarks or promised results.
Here is the receipt the founder should be able to produce:
- ■ Draft generation: $114 first attempts + $6 retries = $120.
- ■ Document summaries: $46 first attempts + $2 retries = $48.
- ■ Automatic tagging: $11 first attempts + $1 retries = $12.
- ■ Total: $171 first attempts + $9 retries = $180.
The provider bill says $180. The feature ledger explains where it went. Both numbers must agree before anyone treats the dashboard as reliable.
02 / Turn three receipt lines into useful unit costs
Suppose that month delivered 6,000 completed drafts, 12,000 completed summaries and 24,000 completed tagging actions. Divide each feature's full cost, including unsuccessful attempts, by its completed actions:
- ■ Draft generation: $120 / 6,000 = $0.020 per completed draft.
- ■ Document summaries: $48 / 12,000 = $0.004 per completed summary.
- ■ Automatic tagging: $12 / 24,000 = $0.0005 per completed tagging action.
These are costs per product action, not per API call. A draft that requires two calls and a retry is still one completed draft. Counting calls as completed work makes expensive workflows look deceptively cheap.
Drafts consume 66.7% of this bill. Tagging consumes 6.7%. That makes draft generation the first place to investigate, even though tagging runs four times as often.
03 / Record one ledger row for every billable attempt
Start with one database table, not a new analytics stack. Record the timestamp, provider request ID, internal action ID, account ID, feature key, model identifier, attempt number, status and usage quantities. Keep feature keys stable: draft.generate, document.summarize and document.tag.
Separate ordinary input tokens, output tokens, cache reads and cache writes according to the provider's billing definitions. Do not assume cached input is free, or count it twice when usage fields overlap. Store the applicable rate version and calculated charge alongside the raw usage.
CheapRelay bills per real token, including cache reads and writes, with no monthly fee or subscription. That makes usage attribution important: your ledger needs to represent the actual billable categories, not just a single total-token counter.
Assign the feature key on the server before sending the request. Propagate the internal action ID through queues and retries. A user clicking once should not create three unrelated accounting records just because a worker retried twice.
04 / Reconcile the $9 retry line before optimizing prompts
Retries account for $9 / $180 = 5% of this example bill. Keep that amount visible rather than hiding it inside successful requests.
Separate transient errors, validation failures and deliberate second passes. A second pass requested by the workflow is not necessarily a retry. Failed attempts can still incur charges; do not automatically assign them zero cost.
At month end, compare your ledger with billed usage for the same time window. Check missing records, duplicate ingestion, rounding and delayed charges. Put unexplained differences in an explicit unallocated bucket. Do not spread them across features merely to make the totals look tidy.
05 / Use the $0.02 draft cost to set guardrails
At the illustrative average, 500 completed drafts cost $10. That is a planning estimate, not a spending ceiling: longer inputs, larger outputs and more retries can change it. Track expensive individual actions alongside averages, then set output limits and account-level budgets.
If you want a pay-as-you-go route for this setup, sign up for CheapRelay. Its OpenAI-compatible API uses https://api.cheapapirelay.com/v1; keep attribution in your application so changing providers does not erase your cost history.
The useful deliverable is not a prettier $180 total. It is a receipt that tells you which feature to inspect, what each completed action costs and whether your next product change actually reduced spending.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-26 | Spend less | EN | $30 a Month for AI: An Indie Hacker’s Receipt A $30 monthly AI budget with token math, cache allowances, retry limits, and practical spending controls for solo builders. |
| 2026-10-26 | Spend less | EN | $3.45 for 95 accepted answers beats cheap tokens A worked receipt shows why token prices can mislead: count retries, rejected outputs and cache charges before ranking models. |
| 2026-10-26 | Spend less | EN | The $0.004 AI Task With a $0.0566 Agent Receipt A hypothetical agent receipt shows how context, retries, evaluation and logging turn a $0.004 task into $0.0566 per accepted result. |
| 2026-10-26 | Spend less | EN | $2.53 for 10,000 JSON Jobs: Read the Receipt A worked JSON-output budget: token costs, schema overhead, retries, and the checks that keep cheap API calls from becoming expensive workflows. |
| 2026-10-26 | Spend less | EN | $0.012 Either Way: Streaming Changes the Habit A token-by-token receipt shows why streaming has no automatic discount, but stopping early and avoiding retries can change your API bill. |
| 2026-10-26 | Spend less | EN | $1.71 to $1.02: A Long-Chat Summarisation Receipt A worked token receipt shows when summarising chat history saves money, including the summary fee, break-even point and caching caveats. |