Introduction
For most of the last decade, a software company's biggest variable cost was a cloud bill that grew slowly and predictably. Artificial intelligence changed that. When your product calls a language model, every customer interaction has a marginal cost: tokens in, tokens out, a few fractions of a cent each time, multiplied by thousands of requests, by dozens of features, by every engineer who has a coding assistant open all day.
That arithmetic is why "AI cost control" has moved from an engineering footnote to a finance priority. The FinOps Foundation's 2026 survey reports that 98% of organizations now actively manage AI costs, up from 63% in 2025 and 31% in 2024. Gartner expects worldwide AI spending to reach about $2.52 trillion in 2026, up 44% from 2025. And yet Harness's survey of 700 engineering and FinOps leaders found that 52% of organizations have no clear, dedicated owner of AI cost, and that over a quarter of AI spend is unaccounted for.
Read those numbers together and the gap is obvious: adoption of AI is racing ahead of the financial discipline needed to run it profitably. This guide is written from the finance side of that gap. It covers what AI spend actually consists of, where it belongs on the income statement, how to accrue and reconcile usage-based bills, how to calculate unit economics per customer and per feature, which technical levers genuinely reduce cost, and how to set up a monthly rhythm that a founder, a CFO or an outsourced bookkeeper can run.
Note: This is educational information, not accounting or tax advice. Classification of costs, capitalization of development spend and cross-border tax treatment depend on your facts and jurisdiction. Several figures below come from vendor-published surveys and secondary trackers; they are flagged where that matters, and you should confirm anything material against primary sources.
Table of Contents
- Why AI Cost Control Became a Finance Problem
- What AI Spend Actually Consists Of
- The Numbers: Adoption, Spend and Waste
- Where AI Costs Belong on the P&L
- Accounting Standards Map: US GAAP, IFRS and Ind AS
- The Gross Margin Reality Check
- Unit Economics: Cost per Customer and per Feature
- Accruals, Prepaid Credits and Month-End Close
- Tagging and Allocation: Who Spent What
- The FinOps Operating Model for a Small Company
- The Engineering Levers: Caching, Batching and Routing
- Pricing So Heavy Users Do Not Sink You
- The Investor and Diligence View
- Forecasting and Budgeting AI Spend
- Variance Analysis: Price, Volume and Efficiency
- Risks and Controls: An Audit-Style Matrix
- Tools vs. Bookkeeping: Where Each Fits
- Cross-Border Notes for Indian and US Teams
- Ten Common Mistakes
- Glossary
- A 30-60-90 Day Implementation Plan
- FAQ
- Conclusion
Why AI Cost Control Became a Finance Problem
Traditional SaaS earns its reputation for high margins because serving one more customer costs almost nothing. Software is written once and copied. AI products break that property. A model call consumes real compute every single time, so cost scales with usage, not with headcount or seats.
Three features of AI spend make it harder to manage than ordinary cloud costs:
- It is metered in unfamiliar units. Cloud finance teams think in compute-hours and storage-gigabytes. AI is billed in tokens, requests, GPU time and context length. The FinOps Foundation's guidance notes that AI costs are tied to tokens, LLM requests and GPU utilization rather than compute hours, which is why existing cloud dashboards often miss them.
- It is spread across many owners. Product teams call model APIs, engineers use coding assistants, sales and support teams use AI features inside SaaS tools, and a data team may rent GPUs. Harness describes four different functions each holding part of the AI bill with no one accountable for the whole.
- It can change overnight. A longer prompt, a new agent loop that calls a tool ten times instead of two, or a customer who discovers your most expensive feature can double a bill in a week. Nearly a third of teams in the Harness survey said they needed a full week to trace the source of a cost spike.
None of this is an argument against using AI. It is an argument for treating AI spend like any other material cost: measure it, assign an owner, allocate it to the thing that caused it, and report it in a way that supports decisions.
What AI Spend Actually Consists Of
Before you can control a cost you need a clean list of what is in it. For most small and mid-size companies, AI spend falls into five buckets.
| Bucket | Typical examples | Who usually causes it | Natural home on the P&L |
|---|---|---|---|
| Production inference | API calls to model providers inside your product, embeddings, agent tool-call loops | Customers using your product | Cost of revenue |
| Self-hosted compute | GPU instances for open-weight models, inference servers | Platform/ML engineering | Cost of revenue (production) or R&D (experiments) |
| Supporting infrastructure | Vector databases, orchestration, observability, data egress | Platform engineering | Cost of revenue if production, otherwise R&D |
| Development and evaluation | Prompt iteration, test runs, evaluations, fine-tuning experiments | Engineering and product | R&D |
| Workforce AI tools | Coding assistants, enterprise chat licenses, AI features in SaaS tools | Every department | Allocated to the using department |
Two details trip people up. First, non-token costs are often larger than the token bill. One 2025 survey cited in a CFO-oriented analysis found data-platform usage (56%) and networking or egress (52%) reported as cost drivers more often than LLM tokens (37%). Second, seat-based AI tools are a different animal from usage-based APIs. A $30-per-user-per-month assistant is a predictable licence; an agent that loops through tools is an open meter.
The Numbers: Adoption, Spend and Waste
The market data below frames why this is worth your time. Sources are named so you can check them; where a figure comes from a vendor or a secondary summary, that is stated.
Adoption of AI cost management
In two years the question shifted from "should we track AI spend?" to "how well do we track it?". The same report found that 90% of respondents manage or plan to manage SaaS spend (up from 65% in 2025) and 64% manage software licensing, so AI cost control is increasingly one part of a broader technology-spend discipline.
Where the money is going
Gartner's table puts AI infrastructure at roughly 54% of 2026 spending, with AI software growing fastest among the large segments (about 60%). The takeaway for a small company is not the trillion-dollar headline but the direction: AI cost is increasingly embedded in software you already buy, which means it will arrive on your bills even if you never build an AI feature yourself.
The visibility and ownership gap
Treat the "26% wasted" number with care: it is what surveyed practitioners estimate, from a vendor-run survey, not an audited measurement. Its value is directional. If even half of it is true for your company, the cheapest margin improvement available is not a new model but a cost owner and a monthly review.
Where AI Costs Belong on the P&L
Misclassification is the most common and most consequential AI accounting error, because it flatters gross margin, which in turn distorts pricing, hiring and fundraising.
The guiding principle, stated consistently across CFO-oriented sources: costs to deliver your product to a paying customer belong in cost of revenue; costs to build your product belong in R&D. Applied to AI:
Cost of revenue (COGS). Production inference embedded in the product: API spend with model providers, self-hosted model compute, vector database costs, orchestration and observability, and AI-specific customer support. OnlyCFO recommends reporting AI inference as its own line, separate from hosting, so you can see gross margin by product.
R&D. Development and test prompts, evaluation and fine-tuning experiments, and internal engineering tools. Engineering, product and design are usually the heaviest token users, and OnlyCFO's view is that this is fine as long as higher spend is justified by added revenue or reduced headcount. One cited benchmark puts average developer AI spend around $1,300 a month.
Sales and marketing. Most AI use in sales and marketing is not token-intensive. Proof-of-concept and trial costs for your own AI product, however, belong here and are often wrongly pushed into COGS.
G&A. Company-wide licences for general AI assistants. These should be smaller than the COGS, R&D and S&M components for an AI-heavy company; if G&A is your largest AI line, something is probably misallocated.
Prototype versus production
One subtlety deserves its own call-out. Early prototyping is closer to a fixed R&D bet. The moment a feature serves paying customers, the same spend becomes a variable cost that rises with every interaction. One analysis frames keeping token spend in R&D as a forecasting error more than an accounting one: it hides a cost that scales with revenue. The clean answer is operational. Use separate API keys or billing projects for production and development traffic from the first day, so classification is a lookup, not a reconstruction.
Allocation method
Do not allocate AI spend by headcount the way you might allocate a shared seat-based tool. Use direct allocation by actual usage per department, per product and ideally per customer. We return to this in the tagging section.
Accounting Standards Map: US GAAP, IFRS and Ind AS
Auditors and diligence teams do not ask "is this AI cost?"; they ask "which standard governs this transaction?". The map below shows where AI spend touches the main frameworks. It is a starting point for a conversation with your auditor, not a substitute for one.
| Topic | US GAAP | IFRS | Ind AS (India) | Why it matters for AI spend |
|---|---|---|---|---|
| Revenue from AI-enabled products | ASC 606 | IFRS 15 | Ind AS 115 | Usage-based and outcome-based pricing, variable consideration, and whether you are principal or agent when you resell model usage |
| Research and development | ASC 730 | IAS 38 (research vs. development phases) | Ind AS 38 | Prompt engineering, evaluation and fine-tuning experiments are usually expensed as research or early development |
| Internal-use software | ASC 350-40 | IAS 38 | Ind AS 38 | Capitalisation only after defined project-stage criteria are met, so most early AI experimentation is expensed |
| Cloud service contracts (SaaS/API access) | ASC 350-40 as amended by ASU 2018-15 | IFRIC 2021 agenda decision on configuration and customisation costs | Generally follows IFRS | Under US GAAP certain implementation costs of a hosting arrangement that is a service contract can be capitalised and amortised over the term; under IFRS they are often expensed. The fees for the service itself are an operating expense |
| GPU hardware you own | ASC 360 | IAS 16 | Ind AS 16 | Capitalise, depreciate over a defensible useful life; shorter lives are common because hardware cycles are fast |
| Dedicated capacity contracts | ASC 842 | IFRS 16 | Ind AS 116 | A contract for dedicated GPU capacity can contain a lease if it conveys control of an identified asset |
| Purchase commitments and minimum spend | ASC 440 and ASC 450 | IAS 37 | Ind AS 37 | Take-or-pay commitments may need disclosure, and shortfalls can create a liability or an onerous-contract provision |
| Foreign-currency invoices | ASC 830 | IAS 21 | Ind AS 21 | Remeasure monetary balances at period-end and record the exchange difference |
Two points deserve emphasis.
Principal versus agent. If you resell access to a third-party model inside your own product, the principal-versus-agent guidance in the revenue standard decides whether you report revenue gross (and the model cost as COGS) or net. The answer changes reported revenue and gross margin percentage even when profit is identical. Decide it deliberately and document the reasoning.
Implementation costs differ by framework. The US model allows capitalising certain implementation costs of cloud service contracts, as KPMG's summary of ASU 2018-15 explains, with amortisation over the hosting term. IFRS preparers often reach a different answer. If you report under more than one framework, for example an Indian subsidiary under Ind AS inside a US parent under US GAAP, reconcile the policies explicitly.
The Gross Margin Reality Check
If you classify production inference correctly, your gross margin will probably look worse than you expected. That is not a mistake; it is the point.
Benchmarks to anchor on, with sources:
- ICONIQ: AI product gross margins averaged 41% in 2024, 45% in 2025 and about 52% in 2026. Inference averages roughly 23% of revenue at scaling-stage AI B2B companies, and 84% of those surveyed reported gross-margin erosion of six or more points.
- Bessemer (February 2026): typical AI gross margins of 50-60%.
- Median public software: about 77%, with one commentator expecting that figure to fall materially within 12-18 months as AI revenue grows.
A worked restatement
The example below is illustrative (not a real company), but the mechanics are exactly what happens when a founder moves API costs out of a catch-all "software" line.
| Monthly line | Amount | Treated as |
|---|---|---|
| Revenue | $100,000 | n/a |
| Hosting | $8,000 | COGS |
| Customer support | $9,000 | COGS |
| Production LLM API | $22,000 | Was "software" opex; belongs in COGS |
| Dev/test LLM API and evaluations | $6,000 | R&D |
- Gross margin as first reported (production API in opex): ($100,000 − $8,000 − $9,000) / $100,000 = 83%.
- Gross margin after correct classification: ($100,000 − $8,000 − $9,000 − $22,000) / $100,000 = 61%.
A 22-point swing, with no change in the underlying business. Investors and acquirers will make this adjustment during diligence anyway. Making it yourself first means pricing, discount and hiring decisions are based on the number that exists. A practitioner write-up cites a founder whose reported margin of 91% became 58% once $34,000 of monthly API bills moved into COGS.
One operator rule of thumb worth knowing: keep LLM costs below roughly 20% of total COGS for a durable model; coding assistants and document agents may run 30-40% and remain viable with deliberate pricing. Treat that as a heuristic from one source, not a standard.
Unit Economics: Cost per Customer and per Feature
Aggregate margin tells you whether you have a problem; unit economics tells you where. The core move is to divide AI cost by something that matters to the business, and to do it in units that do not drift.
The basic cost-per-request formula
Cost per request = (input tokens × input price) + (output tokens × output price), with prices quoted per million tokens. Output tokens typically cost two to six times more than input tokens, which is why verbose responses are expensive.
Illustrative example using a hypothetical price of $3 per million input tokens and $15 per million output tokens:
- 2,000 input tokens: 2,000 / 1,000,000 × $3 = $0.0060
- 500 output tokens: 500 / 1,000,000 × $15 = $0.0075
- Cost per request ≈ $0.0135
At 50,000 requests a month that is about $675. Trivial for one feature, but multiply by agents that make several calls per user action and by thousands of users and the line gets large quickly.
Price caveat: Model prices change frequently and differ widely by tier. A September 2026 tracker (IntuitionLabs, secondary source, not verified against provider pages) listed output prices ranging from well under $1 to $50 per million tokens across economy and flagship models, a gap of more than 80x. Always take current prices from the provider's own pricing page when you build a model.
Heavy users are where margins go to die
Averages hide the distribution. The same plan can have users who cost 50-100x more to serve than others. Here is an illustrative cost-per-customer table using the $0.0135 request cost above and a $49 monthly plan.
| Customer type | Requests / month | Monthly AI cost | Plan price | Margin on AI cost alone |
|---|---|---|---|---|
| Light | 200 | $2.70 | $49 | 94% |
| Typical | 1,500 | $20.25 | $49 | 59% |
| Heavy | 6,000 | $81.00 | $49 | −65% |
The pattern is common enough to be a named hazard: flat pricing combined with variable cost. One analysis gives a similar example in which a $20 monthly user making 5,000 queries at roughly a cent each costs about $50, a $30 loss per heavy user.
The metrics worth tracking
- AI COGS as a percentage of AI revenue, and as a percentage of total revenue, with trend.
- Gross margin by AI product or feature, so you can see which feature subsidises which.
- Cost per active customer, shown as a distribution (median, 90th percentile, maximum), not just an average.
- Correlation between AI COGS and revenue. If cost grows faster than revenue, your pricing is not aligned to usage.
- Leading indicators: tokens per task, calls per task and context size, which move before the bill does.
Accruals, Prepaid Credits and Month-End Close
Usage-based bills do not line up neatly with calendar months. Here is the practical accounting.
Postpaid usage: accrue what you have consumed
Providers commonly bill in arrears. If you used $18,400 of tokens in October but the invoice arrives in November, October's income statement should still carry the cost. At month-end:
- Pull the provider's usage or billing dashboard total for the period.
- Subtract anything already invoiced or already paid for that period.
- Book the difference as an accrued expense.
Illustrative entry: Debit AI inference (COGS) $18,400; credit accrued liabilities $18,400. When the invoice arrives, debit accrued liabilities and credit accounts payable (or cash), with no second expense. This is ordinary accrual accounting; if the distinction between cash and accrual is fuzzy for your team, our guide to cash-basis vs. accrual accounting covers the logic.
Prepaid credits: asset first, expense as consumed
Many providers sell prepaid credits or committed-spend contracts. A typical treatment is to record the purchase as a prepaid asset and release it to expense as credits are consumed. Questions to settle with your accountant or auditor:
- Do credits expire? If so, when is the unused portion written off?
- Are committed-spend minimums enforceable, creating a liability if you under-consume?
- Are volume discounts or promotional credits recorded gross or net?
The four-way reconciliation
A reliable month-end for AI spend ties four sources together:
- Provider dashboard or invoice (what the vendor says you used).
- Your internal usage logs (what your application recorded, tagged by customer and feature).
- The card or bank statement (what you actually paid).
- The general ledger (what you booked).
Differences between 1 and 2 are your most valuable signal: they reveal untagged usage, retry storms or a key being used somewhere you did not expect. Our month-end bookkeeping checklist gives the wider close routine this slots into.
Tagging and Allocation: Who Spent What
Allocation fails when the data is not captured at the moment of the call. The fix is cheap if done early and painful if retrofitted.
Separate credentials by purpose. At minimum: production, staging, development, and one per major internal team. Separate API keys or billing projects are the simplest tagging mechanism a provider offers.
Pass metadata with every request. Customer ID, feature name and environment recorded in your own logs allow cost per customer and per feature even when the provider's invoice shows only a total.
Keep a model and price table. Store the input and output price per model with an effective date, so historical cost calculations do not silently change when a provider reprices.
Centralise through a gateway if you can. A single internal layer that all model calls pass through gives you one place to log usage, apply rate limits and set per-customer budgets.
Allocate direct costs directly, and shared costs by driver. Vector database and observability costs can be shared by the number of requests or the volume of stored data, not headcount.
The FinOps Operating Model for a Small Company
The FinOps community describes cost management as a repeating cycle of three phases. USU's FinOps overview summarises them as follows: Inform (document usage and cost by source, team and application to build a shared baseline), Optimize (analyse that data to find and rank savings by impact and effort) and Operate (carry out the changes and set up continuous monitoring and governance). The same source describes maturity as Crawl, Walk and Run.
Mapped to a company with fewer than 50 people and no dedicated FinOps hire, that looks like this:
| Stage | What it looks like in practice | Typical metrics | Who does it |
|---|---|---|---|
| Crawl | One consolidated list of AI vendors, separate production and dev keys, a monthly look at total spend and the top three cost drivers | Total AI spend, spend by vendor, month-on-month change | Founder plus bookkeeper |
| Walk | Cost tagged by customer and feature, monthly accruals, budget versus actual, gross margin by product | Cost per customer, cost per feature, variance from forecast | Finance lead plus engineering lead |
| Run | Automated anomaly alerts, per-customer budgets enforced at a gateway, price changes tested against unit economics before release | Margin by cohort, forecast accuracy, savings realised versus planned | Finance, engineering and product jointly |
Showback versus chargeback
Both allocate cost to the team or product that caused it. Showback reports the cost without moving money between budgets, which is enough to change behaviour in most small companies. Chargeback actually charges the cost to the consuming team's budget or to a customer contract, which is useful once teams or business units have separate P&Ls. Start with showback; move to chargeback when a department's AI spend becomes large enough that it should compete with its other priorities.
The Engineering Levers: Caching, Batching and Routing
Finance does not write the code, but it should know which levers exist so it can ask the right questions and verify the savings show up in the numbers.
| Lever | What it does | Commonly cited saving | Watch out for |
|---|---|---|---|
| Prompt caching | Reuses repeated context (system prompts, documents) at a reduced input rate | Cached input often priced around 90% below standard input | Cache-write premiums and expiry windows |
| Batch processing | Runs non-urgent jobs asynchronously | Providers commonly advertise about 50% off | Latency; only suits work that can wait |
| Model routing | Sends simple requests to smaller, cheaper models | 50-80% on routed traffic, per one practitioner analysis | Quality regressions on edge cases |
| Shorter outputs | Constrains verbosity, since output tokens cost more | Varies | Over-truncation hurts usefulness |
| Context management | Trims history and retrieved text | Varies | Dropping context that mattered |
One analysis estimates that stacking caching, batching and routing can bring effective per-call cost to roughly a quarter of list price. Treat that as an upper-end illustration of what is possible, not a guarantee. The responsible way to claim savings is to measure cost per unit of work before and after the change, with a quality check on a sample of real tasks.
Rent versus own
Most companies should start by renting through APIs: no capital outlay, no idle-capacity risk, and automatic benefit from falling per-token prices. One CFO-oriented framework suggests staying on APIs until monthly inference spend reaches roughly $50,000-$100,000 before evaluating dedicated or self-hosted capacity. That threshold is a rule of thumb from a single source, but the logic holds: self-hosting trades variable cost for fixed cost and operational burden, which only pays off at sufficient and predictable volume.
A simple self-hosting break-even
Self-hosting converts a variable cost into a largely fixed one, so the question is volume. A simple break-even formula:
Break-even tokens per month = fixed monthly cost of self-hosting / (API price per token − marginal self-hosted cost per token)
Illustrative numbers (hypothetical): fixed cost of $12,000 a month (GPU capacity, engineering time, monitoring), API blended price $4.00 per million tokens, marginal self-hosted cost $0.50 per million tokens.
Break-even = $12,000 / ($4.00 − $0.50 per million) = 12,000 / 3.50 = about 3,430 million tokens a month (roughly 3.4 billion).
Below that volume, the API is cheaper. Above it, self-hosting can win, if utilisation is high, quality is comparable and you have staff to run it. Include the cost of idle capacity, on-call time and model upgrades, which simple comparisons routinely leave out. Capacity commitments and reserved-instance discounts shift the fixed cost, so re-run the calculation whenever contract terms change.
The Jevons paradox in your budget
Prices per token have fallen sharply over the past few years, yet total spend has risen because usage rose faster. One analysis cites average enterprise AI budgets moving from about $1.2 million in 2024 to $7 million in 2026. Do not assume that falling prices will fix a cost problem; cheaper tokens encourage more calls, longer prompts and more automated agents.
Pricing So Heavy Users Do Not Sink You
If cost per customer varies by a factor of 50 or more, a single flat price will either overcharge light users or lose money on heavy ones. Your options:
- Subscription plus usage. A base fee with an included allowance, then metered overage. One source reports that about 92% of AI software companies use mixed models, though that figure is from a single secondary analysis.
- Tiered limits. Fair-use caps by plan, with hard stops or throttling at the cap.
- Credits. Customers buy credits consumed at different rates by feature, which maps cost to price transparently.
- Outcome-based pricing. Charge per resolved ticket or completed report, which works if you can reliably measure the outcome and your cost per outcome is stable.
A common heuristic is to price at a multiple of per-unit token cost (one source suggests 3-5x) so that gross margin survives fixed overhead. Whichever model you pick, revisit it quarterly, because cost per request moves with model choice, prompt design and user behaviour.
The Investor and Diligence View
Investors and acquirers read AI cost through three lenses: how much gross margin you really have, how fast you recover customer acquisition cost, and how predictable the cost line is.
Gross-margin-adjusted CAC payback
CAC payback is only meaningful when computed on gross profit, not revenue:
CAC payback (months) = CAC / (monthly revenue per customer × gross margin)
Illustrative example: CAC of $3,000 and monthly revenue per customer of $250.
- At an 80% gross margin: 3,000 / (250 × 0.80) = 15.0 months
- At a 55% gross margin: 3,000 / (250 × 0.55) = 21.8 months
The same customer, the same price and the same acquisition cost take almost seven months longer to pay back purely because of inference cost. That is why AI margin shows up in valuation conversations and in the Rule of 40 discussion in our SaaS accounting guide.
What a diligence team typically asks for
- Gross margin for the last 12 months, restated so that production inference is in cost of revenue, with a bridge from the previously reported number.
- Monthly AI spend by vendor, environment and, where available, customer and feature.
- The top 10 customers by AI cost and their gross margin.
- Contract terms with model providers: committed spend, expiry of credits, price-change clauses and termination rights.
- Dependence on a single model provider and a plan if pricing, availability or terms change.
- Evidence of controls: who can create keys, spend limits, and how anomalies are escalated.
- Reconciliation of the provider invoice to the general ledger for at least three recent months.
If you can hand over that pack on request, the conversation about AI risk becomes shorter and the valuation conversation is less likely to include a late margin adjustment.
Forecasting and Budgeting AI Spend
Forecasting AI spend by "tokens per month" is brittle. A better approach:
- Forecast cost per unit of work (per workflow, ticket, report or active customer), then multiply by projected volume.
- Use scenarios, not a single point: conservative adoption, aggressive adoption, vendor price change in your favour, and vendor price change against you.
- Set budget alerts and hard limits at the provider level wherever the provider offers them.
- Compare budget to actual monthly, and investigate variance beyond a threshold you set (say 10-15%). Our small business budget template shows a simple variance layout, and the startup financial model guide shows where a COGS-per-customer driver belongs in a model.
Remember that unit economics take time to mature. Practitioner guidance suggests 3-6 months of tagged data before cost-per-customer figures become reliable, and native cloud cost data can lag by 24 hours or more, which matters for real-time alerts.
Variance Analysis: Price, Volume and Efficiency
"AI spend was $18,325 over budget" is a fact, not an explanation. Borrowing from standard cost accounting, split the overspend into three drivers so that the right team can act:
- Volume variance: you handled more tasks than planned.
- Efficiency variance: each task used more tokens than planned (longer prompts, more tool calls, bigger context).
- Price variance: the blended price per million tokens differed from plan (a price cut, a model mix change, discounts).
Illustrative example (hypothetical numbers):
| Driver | Budget | Actual |
|---|---|---|
| Tasks completed | 2,000,000 | 2,300,000 |
| Tokens per task | 8,000 | 9,500 |
| Blended price per million tokens | $5.00 | $4.50 |
| Total tokens | 16,000 million | 21,850 million |
| Total cost | $80,000 | $98,325 |
Total variance: $98,325 − $80,000 = $18,325 unfavourable. Decomposed sequentially:
| Component | Calculation | Amount |
|---|---|---|
| Volume | (2,300,000 − 2,000,000) × 8,000 tokens × $5.00 per million | $12,000 unfavourable |
| Efficiency | 2,300,000 tasks × (9,500 − 8,000) tokens × $5.00 per million | $17,250 unfavourable |
| Price | 21,850 million tokens × ($4.50 − $5.00) | $10,925 favourable |
| Total | $18,325 unfavourable |
Read the story: demand grew (good news, mostly), tokens per task rose 19% (engineering problem, probably prompt or context growth), and a lower blended price masked part of it. Without the decomposition, the favourable price move would have hidden an efficiency problem that will return when prices stop falling. The order of decomposition affects the split between components slightly, so choose a convention and keep it constant.
Risks and Controls: An Audit-Style Matrix
Audit programmes work from a risk-and-control matrix: what could go wrong, what control prevents or detects it, and what evidence proves the control ran. Here is a version sized for a small company.
| Risk | Control | Evidence | Owner |
|---|---|---|---|
| Runaway agent loop or retry storm drives a surprise bill | Provider-level spend caps and daily alerts; per-customer rate limits at a gateway | Alert configuration screenshot, alert log | Engineering lead |
| API key leaked or reused outside its purpose | Keys scoped by environment and team, rotation schedule, secrets manager, immediate revocation procedure | Key inventory, rotation log | Engineering lead |
| Production cost booked as R&D or "software" | Account mapping rule: production project keys always map to COGS; quarterly classification review | Mapping table, review sign-off | Finance lead |
| Month-end cut-off error (usage unbilled) | Month-end accrual from provider usage report; reversal on invoice receipt | Accrual workpaper | Bookkeeper |
| Duplicate or unused AI subscriptions | Quarterly subscription review against card and bank data; owner per subscription | Subscription register | Finance lead |
| Invoice does not match usage | Four-way reconciliation of invoice, usage logs, payment and ledger | Signed reconciliation | Bookkeeper, reviewed by finance lead |
| Unauthorised vendor onboarded ("shadow AI") | Approval step for any new AI tool that handles company or customer data; central card controls | Approval log | Founder or finance lead |
| Vendor price or terms change | Contract calendar; quarterly re-run of unit economics on current prices | Contract register, updated model | Finance lead |
| Currency and tax errors on foreign invoices | Standard FX rate source; tax-line check on every invoice | Rate policy, invoice checklist | Bookkeeper |
| Single-provider dependency | Documented fallback model or provider and periodic test | Fallback test record | Engineering lead |
Segregation of duties matters even in a ten-person company: the person who can create keys and raise spend limits should not be the only person who reviews the bill. If that is unavoidable, have the founder review the monthly summary directly.
Tools vs. Bookkeeping: Where Each Fits
There is a real and growing market of FinOps and AI-cost tools. Names that come up include CloudZero, nOps, Amnic, Revefi, CloudNuro and Finout, among others. Their strengths are real-time visibility, anomaly detection, tagging enforcement and engineering-facing dashboards. For a company with a large multi-cloud footprint and a dedicated FinOps function, they are often the right answer. (We have no commercial relationship with any of them, and this list is not an endorsement.)
Where small and mid-size teams often fall through the gap is the accounting layer:
- Is production inference booked in COGS, and separately from hosting?
- Are unbilled usage and prepaid credits accrued correctly at each month-end?
- Do the provider invoice, the usage logs, the card statement and the ledger reconcile?
- Does the monthly report show gross margin by product and cost per customer, in a format a board or investor can read?
A dashboard answers "what is spending right now?" A close process answers "what did it cost us this month, in the right account, and does it reconcile?" You need both, and the second is where a part-time finance function, whether a fractional CFO or an outsourced bookkeeper, adds the most value for a company that is too small for a dedicated FinOps team. For a stage-by-stage view of when to hire that help, see our guide to the first finance hire for startups.
Cross-Border Notes for Indian and US Teams
Many AI vendors are US-based, so Indian companies typically buy in foreign currency and US companies sometimes serve Indian subsidiaries. Points to check:
- Foreign-currency invoices. Convert at a consistent, documented rate and book exchange differences separately. Our guide to multi-currency accounting and FX gains and losses walks through the entries.
- GST on imported services (India). Whether the vendor charges Indian GST on its invoice or the recipient self-assesses under reverse charge depends on the vendor and invoice. Read the tax line on every invoice, record input credit eligibility correctly, and confirm the position with your CA. Our overview of common GST mistakes for Indian startups covers adjacent pitfalls.
- Cost allocation between entities. If a US parent pays for AI usage consumed by an Indian subsidiary (or the reverse), document the intercompany charge. Transfer-pricing and withholding questions can arise and need professional advice.
- US tax treatment of software development (offshore teams). A CPA-firm summary of the 2025 tax act reports that, for tax years beginning after December 31, 2024, domestic research costs under Section 174A can be deducted when incurred (or amortised over at least 60 months by election), while foreign research costs must still be amortised over 15 years. If AI features are built by an offshore team, including one in India, the location of the work may matter for the US tax result. This is a summary of a secondary source; confirm with a US tax adviser.
- Capitalisation and R&D rules. Whether development spend can be capitalised, and how, depends on the applicable framework (US GAAP, IFRS or Ind AS) and on facts about the project stage. Do not assume. Ask your auditor.
Ten Common Mistakes
- Leaving production inference in a generic "software" or "hosting" line, which flatters gross margin.
- Using one API key for everything, making allocation a guessing exercise.
- Forecasting by tokens instead of cost per unit of work.
- Averaging customer cost and missing the 5% of users who consume half the spend.
- Ignoring non-token costs such as vector storage, egress and observability.
- Not accruing unbilled usage, so months look cheaper or dearer than they were.
- Assuming falling token prices will fix the problem, when usage and context size grow faster.
- Claiming savings without a before-and-after measurement on cost per unit of work.
- Treating committed-spend contracts as invisible until the credits expire.
- No named owner, so everyone sees a bill and nobody is accountable for it.
Glossary
- Token: the unit of text a model processes and bills for; output tokens usually cost more than input tokens.
- Inference: running a trained model to produce an output; the main variable AI cost for most products.
- Context window: the amount of text a model can consider in one request; longer contexts cost more.
- Prompt caching: reusing previously processed prompt content at a discounted rate.
- Batch API: asynchronous processing of non-urgent requests at a discount.
- Model routing: sending each request to the cheapest model that can handle it.
- COGS / cost of revenue: direct costs of delivering your product to customers.
- Gross margin: (revenue − cost of revenue) / revenue.
- Showback / chargeback: reporting versus actually charging costs to the consuming team.
- Accrual: recording an expense when incurred, even if not yet invoiced or paid.
- Unit economics: revenue and cost per customer, feature or unit of work.
- FinOps: the practice of managing technology spend through shared visibility, optimisation and governance.
A 30-60-90 Day Implementation Plan
Days 1-30: Visibility
- Inventory every AI-related vendor and subscription from the last three months of bank, card and invoice data.
- Name one cost owner for usage and one for the monthly close.
- Create separate keys or projects for production, staging and development.
- Enable provider budget alerts.
Days 31-60: Accounting and allocation
- Create a distinct COGS account for production AI inference and an R&D account for development usage.
- Start monthly accruals and the four-way reconciliation.
- Log customer ID and feature with every production request.
- Restate the last three months of gross margin on the corrected classification.
Days 61-90: Unit economics and action
- Publish cost per customer (as a distribution) and gross margin by feature.
- Identify the top 10% of cost-driving customers and review pricing against them.
- Pilot one engineering lever (usually caching or routing) and measure cost per unit of work before and after.
- Put a one-page AI cost report in the monthly management pack: spend by bucket, budget versus actual, gross margin, and the three biggest variances.
FAQ
Split them by purpose. Inference that delivers your product to a paying customer (production chat, embeddings, agent loops) belongs in cost of revenue. Spend used to build the product (prompt development, evaluations, fine-tuning experiments, internal copilots) normally sits in R&D or other operating expense. The practical way to make the split auditable is separate API keys or billing projects for production and development traffic from day one.Should LLM API costs go in COGS or R&D?
Reported benchmarks are well below classic SaaS. ICONIQ's industry average for AI products is about 52% in 2026, up from 41% in 2024, while the median public software company sits near 77%. Bessemer puts typical AI gross margins at 50-60%. Your own number depends on pricing model, customer mix and how much of the stack you rent versus run.What is a normal gross margin for an AI product?
Most providers bill in arrears or draw down prepaid credits. At month-end, take the provider's usage dashboard total for the period, subtract what has already been invoiced or drawn from credits, and book the difference as an accrued expense (debit COGS or the relevant expense, credit accrued liabilities). Reverse it when the invoice arrives. Prepaid credits are typically recorded as a prepaid asset and expensed as consumed; confirm treatment of expiring credits with your auditor.How do I accrue AI usage that has not been invoiced yet?
Divide AI cost by a unit of value: cost per customer, per active user, per workflow, per report or per resolved ticket. Example: 2,000 input and 500 output tokens at an illustrative $3 and $15 per million tokens costs about $0.0135 per request. Multiply by requests per customer per month and compare with the revenue that customer pays. Forecast cost per unit of work, not per token, because token counts per task drift as prompts and context grow.What is unit economics for AI and how do I calculate it?
The three levers cited most often are prompt caching (cached input is commonly priced around 90% below the standard input rate), batch processing for non-urgent work (providers commonly advertise about 50% off) and routing simple requests to smaller, cheaper models. Stacked, these can bring effective per-call cost to a fraction of list price, but test quality on your own tasks before routing traffic.Which levers cut AI spend without hurting quality?
One named person. Harness's 2026 survey of 700 engineering and FinOps leaders found 52% of organizations have no clear, dedicated owner of AI cost, with several functions each holding part of the bill. In a startup this is usually the founder or head of engineering for usage decisions, with finance or your bookkeeper owning the monthly close, accrual and margin reporting.Who should own AI cost in a small company?
Often yes. When an Indian business buys cloud or AI services from a foreign provider, the treatment depends on whether the provider charges Indian GST on its invoice or the recipient must self-assess under reverse charge. This varies by vendor and invoice, so check the tax line on each provider's invoice and confirm with your CA. Also record the foreign-currency conversion and any exchange gain or loss consistently.Do Indian companies need to worry about GST on foreign AI services?
Showback reports each team's or product's AI cost to them without moving money between budgets; chargeback actually charges that cost to the team's budget or to a customer contract. Most small companies should start with showback because visibility alone usually changes behavior, and move to chargeback when a department's spend is large enough to need its own accountability.What is the difference between showback and chargeback for AI costs?
Sometimes, but less often than founders hope. Research and early experimentation are normally expensed. Under US GAAP, internal-use software and certain cloud implementation costs can be capitalized once specific criteria are met, and IFRS and Ind AS apply different tests under the intangible assets standard. Fees paid for model API usage are operating expenses. Agree the policy with your auditor before capitalizing anything material.Can I capitalize AI development costs?
Split the variance into volume, efficiency (tokens per task) and price effects, and show gross margin before and after correct classification. A board needs to know whether the overspend came from healthy demand, from waste that engineering can fix, or from pricing that no longer fits usage. A simple three-line variance table does that better than a total.How do I explain an AI cost overrun to a board or investor?
For the revenue side of the same picture, how subscription revenue is recognised against these costs, see our guide to SaaS accounting, MRR, ARR and deferred revenue.
Conclusion
AI cost control is not mainly a technology problem and not mainly a tooling problem. It is a discipline of four habits: name an owner, separate production from development, allocate cost to the customer and feature that caused it, and close the books on it every month. Companies that do this find out their true gross margin early, price accordingly, and make engineering optimisation decisions with real numbers. Companies that do not tend to discover the problem in diligence, or on the day a single heavy customer costs more than they pay.
The market data says nearly everyone is now trying to manage AI spend; the survey data says most are not yet doing it well. That gap is an opportunity for any team willing to put a little finance rigor around the meter.
If you would like help setting up AI-cost classification, month-end accruals and a gross-margin-by-feature report for your company, get in touch for a free consultation.
Sources
- Gartner: Worldwide AI Spending Will Total $2.5 Trillion in 2026
- USU: 6 takeaways from the State of FinOps report 2026 (summarising FinOps Foundation data)
- Harness: State of AI in FinOps 2026
- OnlyCFO: Where AI Costs Belong on the P&L
- Beancount.io: LLM API cost, COGS and gross margin guide
- Tian Pan: Renting Intelligence, a CFO's mental model for LLM spend
- IntuitionLabs: LLM API pricing and cost-per-task comparison
- KPMG: Cloud computing implementation costs after ASU 2018-15
- Adams Brown: Section 174A and domestic research expenditures
- USU: What is FinOps?