The Classification Error
Open a typical AI startup's P&L. You will see something like this:
| Line | Percent of revenue |
|---|---|
| Revenue | 100% |
| Hosting and infrastructure | 3-5% |
| Customer support | 5-8% |
| Engineering (incl. LLM API) | 25-40% |
| Gross margin | 45-65% |
The LLM API spend is sitting inside engineering. It is bundled with developer salaries, CI/CD costs, and staging environments. And because it is bundled, nobody can separate the production inference cost from the R&D experimentation cost.
This is the single most consequential accounting error in AI-native finance.
The Test
Ask your engineering lead this question: "If we lost our largest customer tomorrow, how much would our LLM bill go down?"
If they cannot answer with a number, you have a COGS classification problem. The cost exists because of the customer. It should be attributed to the customer.
Why This Matters for Pricing
When inference is classified as R&D, pricing decisions are made blind. Consider two customers on a $49-per-month plan:
- Customer Alpha sends 200 requests per day. Their inference cost: $8 per month. Gross margin: 84 percent.
- Customer Beta sends 5,000 requests per day with long context windows. Their inference cost: $180 per month. Gross margin: negative 267 percent.
Both customers pay $49. One is highly profitable. The other is subsidizing the entire operation. Without per-customer cost attribution, you price as if both customers are identical.
The Vendor Invoice Problem
Anthropic, OpenAI, and Google send you one bill. That bill does not break down spend by your customers, features, or workflows. The granularity you need lives in your application layer.
If you do not capture attribution at the point of the API call, the data is gone forever. The vendor invoice arrives as a lump sum, and you absorb it into engineering.
How to Reclassify
The fix does not require a new accounting system. It requires a middleware layer:
async function attributedCompletion(request: LLMRequest) {
const result = await llm.complete(request);
const cost = calculateCost(result, request.model);
await recordCost({
customerId: request.customerId,
feature: request.feature,
model: request.model,
inputTokens: result.usage.prompt_tokens,
outputTokens: result.usage.completion_tokens,
costUsd: cost,
timestamp: Date.now(),
});
return result;
}
Every request is tagged. Every dollar is computed. The data flows into a cost table that can be joined against revenue by customer and period.
What Changes When You Reclassify
Your gross margin number becomes real. Not the blended number that hides profitable and unprofitable customers. The real number, per customer, per feature, per workflow.
Your pricing becomes defensible. You can show a customer exactly what their usage costs you and why a usage-based tier exists. This is not punitive — it is transparent.
Your vendor negotiations improve. When you know which models and endpoints drive the most cost, you can negotiate from a position of data rather than anxiety.
Your board meetings get easier. "Our gross margin is 58 percent, and here is the breakdown by customer cohort" is a stronger answer than "we are investing in growth."
The Timing
ICONIQ reports that inference alone consumes approximately 23 percent of revenue at scaling-stage AI B2B companies. Eighty-four percent of those companies saw their gross margin decline year over year.
If inference is 23 percent of your revenue and you cannot attribute it by customer, you are making pricing, hiring, and fundraising decisions on incomplete data.
Reclassifying inference from R&D to COGS is not an accounting exercise. It is a visibility exercise. And visibility is the prerequisite for every other decision.
William Min is the creator of TokenOps and a Technical Product Manager at Lovie. He has 12+ years of experience building payment infrastructure and fintech products. View his LinkedIn profile.
Sources: ICONIQ Capital, State of AI 2026. Vendor pricing documentation from Anthropic, OpenAI, and Google Cloud. Internal cost attribution patterns from production AI systems.