AI API Monthly Cost Calculator
Built for anyone putting an AI feature in a product. The number that decides whether it works is not the monthly total, it is the cost per user against what you charge.
How the math works
Cost per request = (input tokens / 1,000,000) x input price + (output tokens / 1,000,000) x output price. Monthly = that x requests per user x users. Gross margin = (price - cost per user) / price.
Common questions
- How do I price an AI feature?
- Work out the cost of your heaviest realistic user, not the average one, and price so that user is still profitable. Usage distributions have long tails, and a small number of people generate a surprising share of the tokens.
- What margin should an AI product have?
- Software businesses generally target 70 to 80 percent gross margin. AI features run lower because inference is a real variable cost, but below about 50 percent the economics get fragile as soon as usage grows.
- How do I keep costs from running away?
- Cap output length, cache fixed prompt prefixes, route simple requests to a smaller model, and set a hard per-user rate limit. The limit matters most: it is the only one that bounds the worst case rather than reducing the average.