Waterfall Prompt Chain Cost Calculator

Total cost of a sequential prompt chain with growing context

Ad placeholder (leaderboard)

Cost a sequential prompt chain accurately

A “waterfall” chain feeds each step’s output into the next step’s input. That makes the carried context grow at every step, and because input tokens are billed each time, the total cost rises faster than people expect. This calculator shows the per-step token growth and cumulative bill so you can size a pipeline before you build it.

How context accumulates

At step n, the input is the system prompt plus the original input plus every prior step’s output:

input(n)  = system + initial_input + sum(output(1..n-1))
cost(n)   = input(n)/1M x in_price + output_per_step/1M x out_price
total     = sum(cost(1..steps))

The system prompt and initial input are re-sent on every step, and each new output is permanently added to the carried context, so the input grows linearly while the cost grows roughly quadratically with the number of steps.

Tips for cheaper chains

  • Summarise between steps. Replacing a long output with a short summary before passing it on flattens the input-growth curve dramatically.
  • Use a cheap model for high-volume early steps and reserve the expensive model for the final reasoning step.
  • Reset when you can. If later steps do not truly need the full history, start a fresh request with only the relevant carry-over.
Ad placeholder (rectangle)