AI cost per user is the attributable model cost for a defined user population divided by the number of eligible users in the same period. Define “user” first: an analytics visitor, signed-in person, product account, and paying customer are different denominators. Sum provider-reported usage with the correct price version, retain cached and retried usage separately, and expose any unlinked cost.
Choose the denominator before interpreting cost per user
A denominator acceptance check prevents a cheap-looking average from hiding expensive activated users. In one reporting window, $120 of complete model cost divided by 100 active users is $1.20 per active user. Dividing the same cost by 10 paying users is $12 per payer; neither is the cost of serving only those ten payers. Use the costs attributable to that payer subset for the latter question.
Track the total cost, qualifying user count, cohort/window and inclusion rule together. Retries and failed requests belong in the numerator if billed; unknown usage makes the complete average unknown. Zero qualifying users means an undefined average, not zero cost.
For an agent, a user can succeed zero, one or many times. Compare cost per successful task alongside cost per user. Test a scenario with 150 attempts, $0.02 per attempt, $1 of external cost and 80 successful tasks: $4 total and $0.05 per success.
Before publishing a figure, confirm the same reporting window, deduplicated users, complete usage and explicit currency. Describe the denominator in the metric label, not only in a footnote.
First decide what “user” means
The right denominator depends on the decision. Google Analytics
defines activeUsers as distinct users who visited a
site or app, while sessions counts sessions that
began. Neither automatically equals a signed-in product user or
paying account.
| Denominator | Best for | Required identity | Main limitation |
|---|---|---|---|
| Active visitor | Acquisition and site-wide economics | Analytics visitor | May include people who never used an AI feature. |
| Signed-in user | Individual product usage | Stable internal user ID | Multiple users may belong to one paying account. |
| Account | B2B product economics | Stable internal account ID | Does not show variation between users in the account. |
| Paying customer | Margin and plan decisions | Account linked to payment customer | Excludes free users unless reported separately. |
Calculate AI cost from observed events
OpenAI response usage separates input and output tokens and can report cached input details. Claude provides a token-counting API and documents separate prompt-cache usage. Keep those categories separate because the effective price may differ by model, cache state, tier, region, and date.
Event AI cost = uncached input tokens × applicable input rate + cache-read tokens × applicable cache-read rate + cache-write tokens × applicable cache-write rate + output tokens × applicable output rate + applicable tool or request fees
Use the provider-returned usage from the completed response. For a streamed response, usage may arrive with the final event or chunk, so the wrapper must finish consuming the stream before it records the total. If your application retries a failed or timed-out call, keep each observed attempt. A retry is not free simply because the user saw one final answer.
Do not put a current model price into the SDK. Send usage and model identity, then apply a versioned server-side price. That preserves the price effective when the event occurred and lets unknown models remain visibly unpriced.
Aggregate events before dividing by users
AI cost per eligible user = sum of attributable AI event cost for eligible users ÷ distinct eligible users in the same period
Keep two totals when identity coverage is incomplete: attributable cost belongs to a known user or account, while unallocated cost was observed but cannot be assigned safely. Do not spread unallocated cost evenly across known users. You may separately report a site-wide average using total cost divided by an analytics population, but label it as a portfolio average rather than customer-level cost.
Worked example: portfolio average vs attributable user cost
This hypothetical example uses one month of data. It is not a benchmark and does not represent a Grow or Die customer.
| Observed item | Amount | Treatment |
|---|---|---|
| Uncached input cost | $240 | Included from priced usage events |
| Cache-read and cache-write cost | $30 | Included separately from uncached input |
| Output cost | $360 | Included from priced usage events |
| Failed and retried attempt cost | $45 | Included where the provider reported usage |
| Total observed AI cost | $675 | $540 linked; $135 unallocated |
| Active users | 50 | 42 have stable usage identity links |
Site-wide portfolio average = $675 ÷ 50 = $13.50 per active user
Known attributable average = $540 ÷ 42 = $12.86 per linked active user
Unallocated cost = $135; do not assign it to the 42 linked users
Both averages are valid answers to different questions. The first describes the whole observed product population. The second describes only users with a trustworthy identity link. Neither justifies claiming that every individual user cost exactly that amount.
What AI cost per user cannot tell you
- It cannot tell you whether a user is profitable without observed revenue linked to the same account or customer.
- It cannot prove which feature caused retention, conversion, or a payment. Cost attribution is not causal attribution.
- It cannot expose missing server events. Reconcile event-priced cost with provider organization reports to detect gaps.
- It cannot compare two periods fairly when the user definition, model price version, currency, or reporting window changed.
- It cannot turn a mean into a distribution. A $13.50 average may hide a small group of extremely expensive users.
To connect the cost to what customers pay, read how to calculate AI contribution margin . For the complete framework, see what AI unit economics means and the AI cost attribution product page.