Skip to content
AISpendbook

Guide · 6 min read

Is AI spend COGS or R&D? How to split the provider bill

By AI Spendbook · Published · Updated

Short answer

LLM API spend that serves paying customers in production is cost of revenue; spend on building, testing and evals is R&D; internal assistants belong with the team that uses them. One bill covers all of these, so split each day's billed total by each use's share of request cost, using written rules.

Key takeaways

  • Production AI features are cost of revenue; prompt experiments, evals and staging are R&D; demos are sales and marketing; internal assistants are G&A.
  • Split the billed total, not the token estimate, so the classes add up to the invoice.
  • Request cost per feature or project is only the key for the split.
  • Spend with no request data goes to a default class and should be reported, not hidden.
Rows of wooden blocks and stacks of coins show three usage levels on a gridded ledger.

An OpenAI or Anthropic invoice arrives as one amount. Behind it are customer-facing features, an engineering team testing prompts, a support team using an internal assistant, and maybe a sales demo environment. Putting the whole bill in one account either overstates AI gross margin or understates it, and investors who compare AI companies look at gross margin first. The part that serves customers is AI COGS.

Is LLM API spend COGS or R&D?

ClassWhat belongs thereTypical examples
Cost of revenueSpend that serves paying customers in productionThe AI feature customers use, production agents, customer-facing support bots
Research and developmentSpend on building, testing and evaluatingPrompt experiments, evals, staging environments, fine-tuning runs
Sales and marketingSpend that helps win customersDemo environments, trial accounts, marketing content generation
General and administrativeSpend on running the companyInternal assistants for finance, HR or legal

Where each use belongs is a decision for your company and its accountant. A written split method makes whatever you decide repeatable.

How do you split one OpenAI bill between products and departments?

  1. Tag requests with what they are for. A feature name, project or environment on each request is enough. Most teams already log this or can add it in one place.
  2. Write one rule per use. For example: feature support_bot goes to cost of revenue, project evals goes to R&D. The first matching rule wins, and anything unmatched goes to a default class you choose.
  3. Allocate the billed total, not the estimate. Each day's billed spend per provider is split across classes by each class's share of request cost that day. The invoice total stays intact.
  4. Show what could not be split. Days with billed spend but no request data go to the default class and should be visible as such, not hidden.
  5. Book one journal entry per month. One debit line per class, and each provider credited to accounts payable for billed days and accrued liabilities for days still on an estimate, dated the last day of the month.

class spend (day, provider) = billed spend (day, provider) x class request cost / total request cost

Worked example: splitting one day's bill by request cost

Illustrative numbers. One provider bills $1,000 for a day. Request logs for that day, priced at list rates, add up to $800: the customer support bot $480, eval runs $200, the sales demo environment $40 and an internal finance assistant $80. The shares are 480 / 800 = 60%, 200 / 800 = 25%, 40 / 800 = 5% and 80 / 800 = 10%. Applied to the billed $1,000, cost of revenue gets $600, R&D $250, sales and marketing $50 and G&A $100. The classes add up to $1,000, the bill, even though the estimate was $200 lower.

Illustrative figures for one provider and one day.
UseRuleEstimated costShareBilled split
Support botfeature support_bot to cost of revenue$48060%$600
Eval runsproject evals to R&D$20025%$250
Sales demoenvironment demo to sales and marketing$405%$50
Finance assistantfeature finance_assistant to G&A$8010%$100
Total$800100%$1,000

How to choose the default class

The default class receives spend no rule matches and days with billed spend but no request data. Pick the class where most unmatched traffic is likely to belong. If production traffic dominates, cost of revenue is the cautious choice for gross margin, because it does not flatter the margin. Report the amount in the default class every month so a growing figure gets fixed with a new tag or rule.

Why split the billed total instead of token estimates?

Request-level cost is an estimate: tokens times list price. It misses discounts, caching, batch pricing and credits, so it rarely equals the invoice. Using it only for the split keeps the books on the billed number. See billed vs estimated AI spend.

How does AI Spendbook split AI spend by accounting class?

AI Spendbook's accounting split uses the same four classes: cost of revenue, R&D, sales and marketing, and general and administrative. Rules match one exact value of a feature, project, category, customer, provider or model, and each day's billed spend is allocated by share of request cost. Three rule templates (production versus internal and evals versus sales demos; project per environment; customer support and back office) give a starting set, which only helps if your tags use those names. Each class can carry ERP segments (department, class, location, subsidiary). The month's split is locked with the month-end close, and the balanced journal downloads in NetSuite, QuickBooks Online, Xero, Sage Intacct or Business Central layouts, or can be posted by an admin through an ERP connector (see AI spend journal entries in an ERP).

What are common mistakes when splitting AI spend into COGS and R&D?

  • Putting the whole bill in R&D. It flatters gross margin and is the first thing an investor's diligence team reclassifies.
  • Splitting the estimate instead of the bill. The classes then do not add up to the invoice.
  • Rules that match nothing. A rule for a tag value your telemetry never sends, such as production when requests carry prod, silently sends everything to the default class.
  • Changing rules without a note. A margin that moves because a rule changed looks the same as one that moved because usage changed.

When is a split not needed?

If all AI API spend serves one purpose, for example only internal assistants at a company that sells no AI product, it belongs in one class and needs no split. A split is worth the work once one provider bill pays for both customer-facing features and building or testing them.

What will an auditor ask about the AI cost split?

  • The rules, and when they changed. A written list of which feature, project or environment goes to which class, with a dated note for each change. AI Spendbook can download a policy memo built from the current rules and settings, and its audit log records the old and new value of every rule change.
  • The basis. Billed spend as the total, with request data used only as the key for the split.
  • What could not be classified. The amount that fell to the default class because no request data covered it.
  • The tie-out. Class totals that add up to the billed total, and a journal entry that balances.

Accruals for days not yet invoiced, credits and commitment shortfalls are covered in how to accrue AI API costs.

Frequently asked questions

Are evals and prompt testing on the production API key R&D or cost of revenue?

R&D in most cases, even when they run on the same key as production. Tag those requests with a project or environment such as evals or staging so the split can move them out of cost of revenue.

Can the share of AI spend that is COGS change from month to month?

Yes. The rules stay fixed, but the share moves with usage: a month with heavy eval runs puts more of the bill in R&D. Report the share each month and explain large moves rather than fixing a percentage.

Where do AI tool seats like ChatGPT Enterprise go in the cost of revenue split?

Seats for employees are usually operating expense in the department that uses them, not cost of revenue, unless the seats are used to deliver the service. Keep them on separate lines from API spend.

Start with your own numbers.

Every plan is free during launch. No credit card.