Skip to content
AISpendbook

Free calculator

AI gross margin calculator

Enter one month of revenue, the AI model bill and the rest of cost of revenue. The calculator shows what the model bill leaves of revenue, the gross margin and AI cost as a share of revenue.

$

Recognised revenue of the product or customer you are measuring.

$

Billed provider cost for the same month: tokens, inference, speech.

$

Hosting, third-party APIs, support and payment fees.

Starts with example figures. Everything is worked out in your browser; nothing is sent or saved.

Gross margin

65.0%

$65,000 gross profit

AI contribution

$78,000

78.0% of revenue left after the model bill

AI cost % of revenue

22.0%

AI model cost divided by revenue.

AI share of cost of revenue

62.9%

How much of cost of revenue is the model bill.

How it is calculated

Use the billed provider cost for the month, not a token estimate: discounts, cached tokens, batch pricing and credits change the bill. Billed vs estimated AI spend explains the difference.

AI contribution = revenue - AI model cost gross profit = AI contribution - other cost of revenue gross margin = gross profit / revenue AI cost % of revenue = AI model cost / revenue

Which costs go where

  • AI model cost: production model and inference spend that serves customers, plus speech, telephony and other non-token AI costs if they scale with usage.
  • Other cost of revenue: hosting, third-party APIs, customer support and payment fees.
  • Leave out: experiments, evaluations and internal tools. They are usually R&D, not cost of revenue; is AI spend COGS or R&D shows how to split one bill.

Per customer, not only in total

A healthy total can hide customers who cost more than they pay. Run the same numbers for your largest accounts with the AI cost attributed to each one; AI cost per customer shows how to allocate one provider bill by request data.

For the board, report the trend and the spread across customers, not one month's figure. AI gross margin and board reporting has a template.

What this calculator does not do

  • It works on the numbers you type. It does not read your provider bills or revenue.
  • It stores nothing and sends nothing: the figures stay in your browser and are gone when you leave the page.
  • In AI Spendbook the same split comes from billed spend and Stripe revenue, per customer and per month. See the customer margin docs.

Start with your own numbers.

Every plan is free during launch. No credit card.