The cost model
What it is
The monthly cost of a feature is four numbers multiplied together:
- requests per month;
- tokens per request, input and output counted separately;
- the price per token of the model used;
- plus smaller amounts for embeddings, reranking and extra model calls.
cost = requests × (input tokens × input price + output tokens × output price).
Why it matters
Every way of cutting cost acts on one of those numbers.
- Caching lowers requests. Trimming context lowers input tokens. A length cap lowers output tokens. A smaller model lowers the price.
- Knowing the formula tells you which lever to pull, and lets you estimate a feature's bill on a whiteboard before any code exists.
In the real world: Before approving a new feature, a product lead asks for one number, cost per active user per month, and the engineer derives it in two minutes from this formula.
Support assistant, medium tier (₹250 in / ₹1,250 out per million):
per request 3,700 in + 300 out = ₹1.3
per month ₹1.3 x 1,000,000 requests = ₹13 lakhForgetting the hidden calls. A request that first rewrites the question, then classifies it, then answers, then checks the answer, is four model calls. Count every call the request makes, not only the one that produces the visible answer.