99digest is in early access — tools are free while we grow.
Guide

How to Estimate the Cost of an LLM API Call

API pricing is quoted per million tokens, with separate prices for what you send and what the model writes back. A small calculation shows what a request will cost.

The calculation

Cost = input tokens ÷ 1,000,000 × input price + output tokens ÷ 1,000,000 × output price. The LLM Cost Calculator uses the prices stored in the tool for six Claude models, in US dollars per million tokens (base, uncached prices as listed on Anthropic’s pricing page on 18 October 2026):

Model Input Output
Claude Fable 5.1 $10 $50
Claude Opus 5.5 $4 $20
Claude Opus 5 $5 $25
Claude Sonnet 5.5 $2 $10
Claude Sonnet 5 $2 $10
Claude Haiku 4.5 $1 $5

Prices change. Confirm the current rates on the provider’s pricing page before relying on an estimate. (Claude Sonnet 5 launched with an introductory $2 and $10 price that Anthropic has since made permanent.)

Worked examples

  • A request with 2,000 input and 500 output tokens on Sonnet 5: $0.004 + $0.005 = $0.009.
  • 1,000,000 input and 200,000 output tokens on Haiku: $1.00 + $1.00 = $2.00.

Using the calculator

  1. Choose the model.
  2. Enter the input and output token counts. Use the token counter if you only have text.
  3. Read the input cost, output cost and total.

What is not included

  • Other providers’ models, and older Claude models; the tool covers the six listed.
  • Discounts such as prompt caching (cache reads cost a small fraction of base input) or batch processing, taxes and minimum fees.
  • Extra tokens the system adds, such as hidden instructions or tool definitions.

Output tokens cost several times more than input, so shorter replies save more than shorter prompts.

Frequently asked questions

How do I estimate output tokens?

Think about how long the reply will be: a short paragraph is about 100 to 150 tokens, a page about 600 to 700. Set a maximum on the API to cap it.

Try the LLM Cost Calculator Free, instant, and runs in your browser.