Estimate the cost of an LLM request before you build
Most of the cost of an AI feature is decided before the first line of code, yet it is often just guessed. This lesson shows you how to estimate it reliably from a simple prototype, whatever the provider. You walk into the meeting with a number you can defend instead of a rough order of magnitude.
Updated November 14, 2026.
In short
The cost of an LLM request is the number of tokens sent and generated, each multiplied by its own rate, summed across every call that a single user action triggers. You measure those tokens on a realistic prototype instead of guessing them. For a PM, this is the first number in the business case, and it shifts with the model you pick.
Lesson objective
By the end of this lesson, you will be able to estimate the cost of one complete use of an AI feature before building it, from input and output tokens measured on a realistic prompt and the provider's dated prices.
Questions this lesson answers
How do you calculate the cost of an LLM request before building?
Prototype the prompt, measure how many tokens it holds and how many the reply generates, then apply the provider's current official rate to every call.
Why do output tokens cost more than input tokens?
Providers bill generated text at a higher rate than the text you send, five times higher on the models cited here, so a long reply quickly outweighs the prompt.
Topics covered
- LLM cost per request
- token pricing
- AI feature cost estimate
- LLM API pricing
In the glossary
Where it fits
Estimate the cost per use
How much will each use of the feature cost, and each user per month, before it is even built?
Lessons in this module
- Estimate the cost of an LLM request before you build (this lesson)
- History, caching and heavy users
- The fixed and hidden costs of an AI feature
What you will learn in this module
This lesson is part of the course Build the business case for an AI feature
- Estimate, before building it, the cost per use and per user of an AI feature (input and output tokens, model, history, caching, heavy users), then its fixed and hidden costs.
Related courses
- AI & FundamentalsAll levelsNo prerequisites: accessible to everyone.
Understand what LLMs do well, and where they fail
2 hr
- AI & ProductExpertAdvanced level: for deeper mastery and specialization.
Ship and monitor an AI feature in production
3 hr
- AI & FundamentalsJuniorSome basics are useful: introductory knowledge of the topic.
Prompting for Product Managers: delegate, describe, verify
2 hr 45 min