Skip to content
Technologyai

LLM Token Cost Calculator

Model API cost from token volumes. Output tokens usually price three to five times input, so a small share of the tokens drives most of the bill, and shortening responses saves more than shortening prompts.

Also called: api token cost calculator, gpt cost calculator.

%
%
Monthly cost
₹1,12,500

₹1,12,500 a month for 1,00,000 requests: ₹50,000 on input and ₹62,500 on output. Output is 55.56% of the bill from 20% of the tokens, because it prices 5 times higher. Cost per request is ₹1. No prompt caching applied. A stable system prompt or shared context is usually worth caching.

Input cost
₹50,000
Output cost
₹62,500
Output share of cost
55.56%
Output share of tokens
20%
Output to input price ratio
5
Cost per request
₹1
Saving from prompt caching
₹0
Total tokens, millions
250
On prompt caching
No prompt caching applied. A stable system prompt or shared context is usually worth caching.
On prices
Prices are inputs, not constants. Model pricing changes often, so take the current rate from the provider rather than relying on a default here.
Method and background

How this is calculated

Cost is requests times tokens times price per million, priced separately for input and output. The asymmetry is the useful insight: output typically costs several times input, so a response of 500 tokens can cost more than a prompt of 2,000. That inverts the usual optimisation instinct, which is to trim the prompt. Prompt caching, where a repeated prefix is billed at a large discount, is the other major lever and suits any workload with a stable system prompt or shared context.

output tokens typically price several times input, so a verbose response costs more than a long prompt
n
Requests
t
Tokens

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

100,000 requests a month

Requests a month
1,00,000
Input tokens per request
2,000
Output tokens per request
500
Input price per million tokens
₹250
Output price per million tokens
₹1,250
Prompt cache hit rate
0%
Discount on cached input
90%

Monthly cost₹1,12,500

200M input at 250; 50M output at 1250

Open this example

caching most of the input cuts the bill

Requests a month
1,00,000
Input tokens per request
2,000
Output tokens per request
500
Input price per million tokens
₹250
Output price per million tokens
₹1,250
Prompt cache hit rate
80%
Discount on cached input
90%

Monthly cost₹76,500

boundary: 80 percent of input at a 90 percent discount

Open this example

Method and limits

What it assumes

  • Token counts you supply. Actual tokenisation varies by model and language.

What it deliberately does not model

  • A token is roughly four characters of English and considerably fewer for other scripts.
  • Cached input pricing and eligibility rules differ by provider.
  • Batch and asynchronous tiers often price lower and are not modelled here.

Formula version 1.0.0 · definition 1.0.0 · India · Report a problem with this calculator

Frequently asked questions

Why is output so much more expensive?
Generating tokens is sequential and compute-bound where reading a prompt can be processed in parallel. Providers price that difference, typically at three to five times.
What should I optimise first?
Response length, usually, since output prices highest. After that, prompt caching for any stable prefix, which discounts repeated input heavily.