How to account for AI inference costs
Cost of revenue or R&D, accruing usage billed in arrears, prepaid and promotional credits, and the month-end entries, in plain language.
By Keyveve, Inc. · Updated 2026-10-22
AI inference has become a real line in the P&L of software companies; for many AI products it's one of the largest costs after payroll. It also arrives in an awkward shape: usage-based, billed in arrears or drawn from prepaid credits, shared between the product and the team building it. Here's how finance teams commonly handle it. Treat it as a starting point for a conversation with your accountant, not as advice for your specific situation.
1. Classify: cost of revenue or operating expense?
The question is what the inference was for:
| Inference that… | Usually classified as |
|---|---|
| serves paying customers in your product, in production | Cost of revenue (COGS) |
| runs in development, staging, evaluation or experiments | Research and development |
| powers internal tools (support macros, finance automation) | General and administrative, or the function that uses it |
| generates marketing content or sales outreach | Sales and marketing |
Classification matters because gross margin, the number investors look at first for AI companies, only includes cost of revenue. Putting production inference in R&D flatters gross margin; putting development spend in COGS understates it.
The practical problem is that a provider invoice is one number. To split it you need to know which feature and environment each call came from. That's what tags on each call give you: feature and environment map directly to these categories.
2. Accrue costs in the month they're incurred
Most API usage is billed in arrears: you use it in March and the invoice arrives in early April. Under accrual accounting, March's expense belongs in March. A common pattern:
- Month end (March 31). Debit the expense accounts for March's usage, credit an accrued liabilities account.
- First day of the next month (April 1). Reverse the accrual.
- When the invoice arrives. Book it as usual against accounts payable and the expense accounts. The reversal cancels the accrual so March isn't counted twice.
The amount to accrue is best taken from the provider's own cost reports (OpenAI and Anthropic both publish daily costs through their admin APIs), not from estimates.
3. Prepaid credits are an asset
Credits you paid for upfront are a prepaid expense, a current asset. Each month, move what was used from the asset to expense: debit expense, credit prepaid credits. Unused prepaid credits that expire are written off when they expire.
4. Promotional credits cost nothing
Startup-program credits aren't something you paid for, so there's usually no asset. Usage they cover has no cost to record. Track them anyway, for two reasons: they hide your true run rate (the cliff when they run out is real), and investors will ask what margin looks like without them.
5. The month-end entry
Putting it together for one month:
| Account | Debit | Credit |
|---|---|---|
| Cost of revenue: AI inference | $8,912.40 | |
| R&D: AI inference | $1,204.77 | |
| Prepaid AI credits | $2,500.00 | |
| Accrued AI costs | $7,617.17 |
Plus a reversing entry on the first of the next month for the accrual.
6. Write down the method
Auditors and acquirers will ask how the numbers were produced. Keep a short note per month: the source of the costs (provider cost reports or your own records), how calls were classified, the pricing version used, and how credits were applied.
Doing this with Veqen
Veqen's monthly close (on Team, or as an add-on to Pro) produces exactly this: costs from OpenAI's and Anthropic's cost APIs, or the invoice you enter for any other provider, classification by project, feature and environment, credits drawn down first-expiring first, the accrual and its reversal, a written method, and journal entries ready to import into QuickBooks Online or Xero.
Veqen records what every AI call cost and who it was for, reconciles it to your provider bills and produces the journal entries. Start free or read the quickstart.