The Unit Economics of AI Features: Cost per Interaction to Margin

Every AI feature carries real marginal cost. How to build a cost-per-interaction model, which levers cut it, and where the cost lands in your LTV math.

By Prateek Jain
9 min readIntermediate

In April 2026, the weighted average price businesses paid for AI tokens was about $0.72 per million, according to Ramp's spend data1. A feature's bill depends on how that price combines with tokens per call, calls per task, and monthly usage. Model those costs before setting a price or usage allowance.

Where AI features break the SaaS margin model

Metered model calls add usage-dependent costs to the hosting and support costs covered in our CAC/LTV guide. Those costs need to be included when estimating an AI feature's gross margin.

The gap shows up in margins because inference cost grows with usage. Gross-margin comparisons need matching definitions of revenue, hosting, support, model cost, and customer mix, so a broad SaaS band cannot establish what an individual AI feature will cost. Model the feature's own serving cost against its price and usage instead.

Feature design choices affect those costs: how much context the prompt carries, which model tier serves the request, how many retries the error handler allows, and whether a task runs as one call or an agent loop of five. Include those assumptions in the specification and check them against measured usage.

Build the cost-per-interaction model

An interaction is one user-triggered task, such as summarizing a ticket or drafting a reply. It may involve several model calls, and each of those calls contributes to the cost.

cost per interaction = tokens per call × blended price per token × calls per interaction monthly AI COGS = cost per interaction × interactions per month

This simplified formula assumes a blended token price and an average token count per call. For a production estimate, calculate input, output, and cached-token costs at their respective rates for each call, then sum them.

Take a fictional feature: a support-ticket summarizer inside a helpdesk product. Whenever an agent opens a ticket, the feature condenses the thread into a five-line summary.

Line itemValue
System prompt and instructions1,000 tokens
Ticket thread (trimmed)3,000 tokens
Output summary300 tokens
Calls per interaction (including retries)1.15
Tokens per interaction~4,950
Blended token price (Ramp weighted average, April 2026)1$0.72 per million
Cost per interaction~$0.0036
Monthly cost at 50,000 tickets~$178
Monthly cost at 1,000,000 tickets~$3,560

The blended average does not represent the price of a specific model or its input/output mix. Use the rates for your chosen model when estimating the feature's cost. Design choices also affect the token and call counts: Trim the thread harder and the input shrinks. Cap the summary at three lines and the output shrinks. Allow three retries instead of one and the multiplier grows.

What businesses actually spend in 2026

Ramp publishes AI cost data drawn from spend across the businesses on its platform. Three figures from its April 2026 data1:

  • Weighted average price paid: about $0.72 per million tokens
  • Median business AI spend: about $2,246 per month
  • Mean business AI spend: about $140,842 per month

The median and mean are roughly 60 times apart. Ramp attributes the gap to a small number of teams or automated workflows with high spend. The figures describe Ramp's observed businesses and model mix, not a market-wide spending target. Use your own expected tokens, model tier, and usage volume for a feature forecast.1

The five levers

Use the cost model to identify which changes would reduce spending for the feature:

LeverWhat it doesWhat it costs you
Prompt cachingBills repeated context (system prompt, tool definitions, shared docs) at a cache-read discount instead of full input priceOnly works when context is stable across calls; unique-per-call content gets nothing
Model routingA small, cheap model handles the easy majority of requests; hard cases escalate to a frontier modelAn eval set that defines "easy", plus an escalation path
Context trimmingSends the 3,000 tokens the task needs instead of the 30,000 in the recordEngineering work on retrieval and history summarization
BatchingNon-urgent jobs run through discounted batch endpointsLatency: results arrive in minutes or hours, not seconds
Output capsMax-token limits and terse formats cut output tokens, which are priced above input tokens on vendor price listsOccasional truncation, so you need a retry path

Caching savings depend on how much context repeats across calls. Providers bill cache reads at a discount to fresh input tokens, but the discounts and minimums differ by vendor and change often, so model against the current pricing page rather than any blog post, including this one.3 The variable you control is the hit rate. A feature with a long, stable system prompt and shared reference docs can serve most of its input from cache. A feature whose input is mostly unique user content, say a fresh document on every call, caches almost nothing regardless of the discount.

Where it lands in LTV and the feature review

Per-interaction costs become per-user costs, and per-user costs change your unit economics. Suppose a drafting assistant costs $0.02 per interaction blended, and the median active user triggers 20 interactions a month. That is $0.40 per active user per month in COGS that did not exist before the feature shipped.

Now run it through the margin math. A product at $50 ARPU with 80% gross margin contributes $40 per user per month. The $0.40 feature drops that to $39.60, and margin to 79.2%. A heavier agentic feature at $4 per active user per month drops contribution to $36 and margin to 72%. At 4% monthly churn (a 25-month average lifetime), LTV falls from $1,000 to $900. If CAC is $300, the LTV:CAC ratio moves from 3.3 to 3.0. In this example, acquisition cost, pricing, and churn stay constant while the higher serving cost lowers LTV. Review the ratio alongside payback, cash needs, and the chosen LTV method in the LTV:CAC guide.

Plug your own numbers in. Set gross margin to the post-AI figure and watch what happens to lifetime value:

The same math belongs in the build decision. Put cost per task next to any measured retention impact, price, and expected usage. A feature with higher per-user cost may need a price change, usage limit, or evidence that it creates enough value to support the margin impact. The pricing strategy guide covers usage-based add-ons, credit packs, and tier gating. For the build-versus-run comparison, put the development cost against the ongoing margin impact:

FAQ

Do AI feature costs belong in CAC or COGS? Serving costs for a live feature are commonly included in COGS, while AI spend on acquisition, such as ad-creative generation or outbound automation, may belong in fully loaded CAC. Confirm the accounting treatment with finance and apply it consistently because these costs affect different sides of the LTV:CAC ratio.2

How do I estimate token counts before launch? Run representative samples through the target model's tokenizer and inspect the distribution, not only the average. A rough fallback for English text is about four characters per token. Then instrument actual token usage from day one because production inputs can differ from test samples.

What cost per interaction is too high? There is no universal threshold. Compare monthly AI cost per active user with per-user contribution margin, expected usage, and the value the feature is intended to create. Set a price, allowance, or spend limit that fits those assumptions before launch.

Will falling token prices fix my margins on their own? No general forecast can answer that. Listed price, model tier, tokens per task, cache hit rate, retries, and volume all affect the bill. Reforecast from current provider pricing and measured usage when any of those inputs changes.

Should an AI feature be free or paid? Start from cost per active user versus contribution margin and the value the feature creates. A usage allowance, credit pack, or higher tier can fit when serving cost varies materially with use. The pricing strategy guide walks through the structures.

Sources

Footnotes

  1. How much do AI tokens cost businesses? Ramp. Figures as published by Ramp from anonymized spend data on its platform, April 2026: weighted average ~$0.72 per million tokens, median monthly AI spend ~$2,246, mean ~$140,842. ↩ ↩2 ↩3 ↩4

  2. Treatment of serving costs can vary by accounting policy and contract terms. Confirm your company's treatment with its finance team before using gross-margin calculations for a business case. ↩ ↩2

  3. Provider cache-read discounts, cache minimums, and batch-tier pricing change frequently and vary by vendor. We have deliberately not quoted per-vendor figures; model your costs against the provider's current pricing page. ↩