Skip to content
Module
Module 3 of 6Lesson 1 of 3~14 min

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

Full 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

  1. Estimate the cost of an LLM request before you build (this lesson)
  2. History, caching and heavy users
  3. 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.