Skip to content

What LLM Tokens Really Cost (and How to Estimate Your Bill)

Tokens, context windows, input vs output pricing: how large language model costs add up, and how to estimate your monthly bill before it surprises you.

Computing···4 min read

What a token actually is

Large language models don't read characters or words. They read tokens. A token is a chunk of text, roughly ¾ of a word on average in English. A useful rule of thumb:

  • ~4 characters ≈ 1 token
  • ~750 words ≈ 1,000 tokens
  • A dense page of text ≈ 500–800 tokens

Punctuation, code, and non-English text tokenize differently (often more tokens per character), so treat these as estimates, not guarantees.

Why your bill has two prices

Almost every API charges input tokens and output tokens at different rates, and output is usually several times more expensive. That matters because the two scale differently:

  • Input grows with your prompt and everything you stuff into context (instructions, retrieved documents, chat history).
  • Output grows with how much the model writes back.
Output tokens cost 2 to 6 times as much as inputList price per million tokens for five models, standard tier, October 2026InputOutput
Providers' pricing pages, checked October 4, 2026 (the data behind our LLM token budget calculator)
Show the numbers
ModelInputOutput
GPT-6.1 Sol$2$10
Claude Sonnet 5.5$2$10
Gemini 3.1 Pro$2$12
Gemini 3.8 Flash$0.75$3.75
DeepSeek V4 Pro$1.30$2.60

A chatbot that quotes long documents but answers briefly is input-heavy. A code generator or writing assistant is output-heavy. Knowing which you are tells you where to optimize.

The context window trap

The biggest surprise in most bills is conversation history. In a multi-turn chat, many implementations resend the entire prior conversation as input on every new message. So turn 20 might send 20 turns' worth of tokens, even though the user only typed one line.

Resending the whole chat makes input grow with the square of its lengthInput tokens sent so far, when every turn adds 200 tokens of question and answerWhole chat resentOnly the new turn
Worked example: turn n resends n × 200 tokens
Show the numbers
TurnWhole chat resentOnly the new turn
1200200
2600400
31,200600
42,000800
53,0001,000
64,2001,200
75,6001,400
87,2001,600
99,0001,800
1011,0002,000
1113,2002,200
1215,6002,400
1318,2002,600
1421,0002,800
1524,0003,000
1627,2003,200
1730,6003,400
1834,2003,600
1938,0003,800
2042,0004,000

Costs then grow roughly with the square of conversation length if you're not careful. Mitigations:

  • Truncate or summarize old turns instead of resending them verbatim.
  • Cache stable parts of the prompt where the provider supports it.
  • Retrieve only the relevant snippets rather than dumping whole documents.

Estimating a monthly bill

The basic formula per request is:

cost = (input_tokens  × input_price_per_token)
     + (output_tokens × output_price_per_token)

Then multiply by requests per day and days per month. The parts people underestimate:

  • System prompt + retrieved context: often larger than the user's actual question.
  • Retries and tool calls: an agent that calls tools loops through the model multiple times per user turn.
  • Growth: traffic rarely stays flat.

Rather than do this by hand, plug your numbers into the LLM token budget calculator to project a monthly cost.

For example, a support bot that sends 1,500 input tokens and gets 300 back, 10,000 times a day for 30 days on Gemini 3.8 Flash: 450 million input tokens at $0.75 per million and 90 million output tokens at $3.75 per million are $337.50 each, so the output is a sixth of the tokens and half the bill.

The LLM token budget calculator with 1,500 input and 300 output tokens per request, 10,000 requests a day, Gemini 3.8 Flash at $0.75 in and $3.75 out per million tokens, no caching. It shows $675 a month, $0.002250 per request, $22.50 a day and 540 million tokens a month. A cost-per-request bar is split evenly: input $0.001125, output $0.001125. A comparison lists the same traffic on other mid-size models, from $122 on gpt-oss-120B to $1,800 on GPT-6.1 Sol and Claude Sonnet 5.5.

API vs self-hosting

At low-to-moderate volume, a hosted API almost always wins on total cost of ownership: you pay only for what you use and skip GPUs, ops, and idle capacity. Self-hosting starts to make sense at high, steady volume, where fixed infrastructure amortizes across enough requests.

The crossover depends on your throughput, model size, and how well you'd keep the hardware busy. The self-hosted vs API calculator lets you compare the two for your specific load instead of guessing.

The short version

  • Tokens ≈ ¾ of a word; budget both input and output, and output costs more.
  • Conversation history and retrieved context are usually the hidden cost drivers.
  • Estimate before you launch, then watch real usage. The first bill is where assumptions go to die.
engineeringaillmtokenscostapi

Share this post