Skip to content
MAMasterAI Now
Inference & Cost6 min read

How to Price an AI Feature: Cost per User and Gross Margin

Learn how to price an AI feature: estimate LLM cost per request and per user, set usage limits, and protect gross margin with a simple worked example.

By MasterAI Now Team

An AI feature has a cost that grows with usage, unlike most software. A normal feature costs you roughly the same whether a user clicks it once or a thousand times. An AI feature bills you per request, and a few heavy users can erase the margin of an entire plan. The fix is to price from cost per request and cost per user, not from guesswork or from what competitors charge.

This guide walks through the full calculation with a worked example: cost per request, cost per user across light, typical and heavy usage, margin after payment fees, how to set a price floor and a usage cap, and which hidden multipliers break the estimate.

Step 1: Cost per request

The basic formula is:

cost per request = (input tokens x input price + output tokens x output price) / 1,000,000

Prices are quoted per million tokens, and answers are usually priced higher than prompts. Measure a realistic prompt with the instead of guessing. Include everything the model receives: system prompt, history, retrieved text and the user's message.

Hypothetical example: 1,500 input tokens at $0.50 per million, and 500 output tokens at $2 per million.

  • Input: 1,500 x 0.50 / 1,000,000 = $0.00075
  • Output: 500 x 2 / 1,000,000 = $0.00100
  • Total: $0.00175 per request

If you do not know your token counts yet, shows a quick method.

Step 2: Cost per user

Multiply by the number of requests a user actually makes. Use three tiers, not one average:

User typeRequests per monthLLM cost
Light20$0.035
Typical100$0.175
Heavy2,000$3.50

The heavy user costs 20 times the typical one. Averages hide this, and in AI products the heaviest few percent of users often account for a large share of total cost. If you already have analytics, replace these tiers with your real distribution.

Step 3: Margin on a real plan

Say your plan costs $9 per month and your payment provider charges 4% plus $0.40, which is $0.76 on this plan. Fee structures vary by provider, so use your own numbers.

  • Typical user: $9 - $0.76 - $0.175 = $8.065, a gross margin of about 90%
  • Heavy user: $9 - $0.76 - $3.50 = $4.74, a gross margin of about 53%

The heavy user is still profitable, but one change can flip that: a model that costs four times more, or a feature that triggers several model calls per click. Run the same arithmetic again for every new feature, not only at launch.

Step 4: Set a price floor

You can work backwards from a target margin. Let p be the plan price, with a fee of 4% of p plus $0.40, a per-user LLM cost c, and a target gross margin of 70%. Solving gives:

p = (0.40 + c) / (1 - 0.04 - 0.70) = (0.40 + c) / 0.26

  • Typical user, c = $0.175: p = about $2.21
  • Heavy user, c = $3.50: p = about $15.00

So a $9 plan comfortably supports a typical user, but a heavy user needs a higher price or a limit.

Step 5: Set a usage cap

Flip the formula to find the largest cost a $9 plan can absorb at a 70% margin:

allowed LLM cost = 9 - 0.76 - (0.70 x 9) = $1.94

At $0.00175 per request, that is about 1,100 requests per month. A fair cap on this plan is therefore around 1,000 requests. Show remaining usage in the interface, and offer a top-up or a higher tier beyond the cap. A limit that protects your margin feels fair when users can see it coming.

Step 6: Treat free users as a cost line

Free users pay nothing and still cost money. If 1,000 free users each make 20 requests per month, that is 20,000 requests x $0.00175 = $35 per month. That is cheap at this scale, but it grows linearly with signups, and a viral week can multiply it. Cap the free tier tightly, and consider cheaper models for it. For provider free tiers you might rely on during development, read first.

Step 7: Watch the hidden multipliers

Your per-request estimate can be wrong by a large factor if you ignore these:

  • Reasoning models add hidden thinking tokens that you pay for as output. See .
  • Agents make several model calls per task. shows where the cost builds up.
  • Long conversations resend the history on every turn, so cost per message rises as the chat grows.
  • Other languages can inflate token counts. See .
  • Retries and errors bill you for failed or repeated calls.

Step 8: Reduce the cost, not just raise the price

  • Route simple tasks to a cheaper model and keep the expensive one for hard cases. Compare options in the , and see the trade-offs in .
  • Use for repeated or non-urgent work.
  • Shorten prompts and cap the maximum output length.
  • Cache answers to identical or near-identical questions.

Step 9: Know when to self-host

At high, steady volume a fixed GPU bill can beat a per-token bill. Enter your own rental price and your own measured throughput into the , and read . Below the break-even volume, the API is almost always cheaper once you count idle time and engineering effort.

Choosing a pricing model

  • Flat subscription is simple, but exposes you to heavy users unless you add a cap.
  • Usage-based pricing matches revenue to cost exactly, but many customers dislike unpredictable bills.
  • Credits let you sell a predictable bundle and charge different amounts for different actions.
  • Hybrid plans combine a base fee with an included allowance and paid overage, and are the most common choice for AI products.

Simulate your monthly bill

Put your prompt size, answer size and expected requests into the to compare every priced model side by side, then plug the result into the margin formulas above.

Checklist

  • Measured real input and output tokens
  • Calculated light, typical and heavy users separately
  • Included payment fees in the margin
  • Computed a price floor and a usage cap from the target margin
  • Set a free-tier limit and per-user usage limits
  • Accounted for reasoning tokens, agent steps and conversation history
  • Re-checked model prices before launch, because they change