Guides / ai cogs calculator
AI COGS, and what actually belongs in it
AI cost of goods sold is the model spend required to serve a paying customer, including retries and discarded output, excluding research and evaluation runs. Most teams under-count it by leaving waste out. Culpa, a local-first LLM cost, margin, and forecast ledger, meters every call including failures, so your COGS reflects spend rather than intent.
Why this happens
COGS goes wrong in two directions at once. Teams exclude retries and discarded responses, which understates the real cost of serving, and they include evaluation and development traffic, which overstates it by charging research to the customer line. The result is a number that's wrong in both directions and reconciles with nothing. Getting it right needs per-call attribution that separates customer-serving traffic from everything else.
What this usually looks like
- Your COGS figure doesn't reconcile with your provider invoice in either direction.
- Evaluation runs and background jobs are folded into the same bucket as customer traffic.
- Retries are excluded because they felt like errors rather than costs.
- Nobody can state COGS for a single named customer without a manual exercise.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Mistakes that cost the most
| Mistake | Why it hurts | Do instead |
|---|---|---|
| Excluding retries and discarded responses from COGS. | Both bill in full, so COGS reads low by exactly your waste ratio and worst during incidents. | Count every billed token, then track separately how many you actually used. The ratio is the metric. |
| Including evaluation and development traffic in COGS. | That's research spend, not cost of serving, and it makes your unit economics look worse than reality. | Tag eval and background runs as their own features so they sit outside the customer-serving line. |
| Computing COGS once and reusing the figure. | Model mix, prompt length and provider rates all drift, so a stale COGS misprices every decision built on it. | Recompute monthly from the ledger at the rates in effect for that month. |
Run this check tonight
- Sum every billed token attributable to customer-serving traffic last month, retries included.
- Subtract anything tagged as evaluation, development or background work.
- Divide by paying customers. That's your COGS per customer, and it will exceed your estimate.
- Express COGS as a percentage of revenue. That single number is your gross margin.
- Check what share of spend has no attribution at all. That gap is the honesty of the whole figure.
The same month, COGS counted two ways
Illustrative example
A month with $1,000 of total provider spend on GPT-5.4 at $2.50 and $15.00 per million. The split below is modelled but the rates are real.
The headline margin barely moved while $320 was misattributed in both directions. The number looked stable precisely because two errors offset, which is the worst way to be right.
Every number, with its confidence and source
| Figure | What it means | Confidence | Source |
|---|---|---|---|
| $700 to $880 | modelled customer COGS range, naive count versus corrected, against a $1,000 month | estimated | Modelled split of a $1,000 month priced at real GPT-5.4 rates from the price book, effective 2026-07-02. Published as a scenario because no customer data backs it. |
| $140 to $320 | modelled misattribution range hidden by two offsetting errors, one leg alone versus both | estimated | The $180 excluded retries plus the $140 wrongly included eval spend, from the teardown arithmetic. |
What a generic answer can’t know
A provider invoice is one total. Splitting it into customer-serving spend, waste and research needs a tag attached when each call is made, and those tags only exist inside your application. Culpa captures them on your infrastructure, keeps your prompts and responses there, and counts the calls to run your plan.
Questions founders ask next
Do retries belong in AI COGS?
Yes. A retried call bills in full and it happened in the course of serving a customer. Excluding it makes COGS read low by exactly your waste ratio, and the understatement is worst during the incidents you most want to understand.
Should evaluation runs count as COGS?
No. Eval and development traffic is research spend, not cost of serving. It belongs in its own line, tagged at capture, or it inflates your unit economics and hides how much you spend on testing.
How do I get COGS for one named customer?
Attach a customer identifier to every outbound call at request time. Without it the calls are anonymous afterwards and no analysis recovers the mapping, so per-customer COGS becomes impossible rather than merely difficult.
On your infrastructure
Culpa runs on your infrastructure. Your prompts and responses never leave it. Culpa counts calls to run your plan, and it fails open, so if it ever breaks your app keeps running.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Keep reading
Sources: OpenAI API pricing. Last reviewed 2026-08-01. Plain text version.