Guides to LLM pricing and cost control
Long-form explanations of how large language model billing actually works — written to answer the questions the calculator raises but cannot fit on one screen.
The calculator gives you a number. These guides explain where that number comes from, which of its assumptions are load-bearing, and what to change when the answer is too expensive.
They are written for people who are building something and want to understand their bill properly — not marketing comparisons, and not restatements of provider documentation. Each one covers a mechanism: why output tokens cost more than input tokens, why conversation cost grows quadratically, what a cache hit actually requires, where the break-even point for self-hosting sits. Every guide lists its assumptions, and every figure is one you can check against a provider's own rate card.
All of them are free, none of them are gated, and the methodology page documents the calculations behind the tool itself.
-
LLM API pricing explained: what you are actually paying for
Input tokens, output tokens, cached reads, reasoning tokens and batch discounts — a plain-English breakdown of every line item on an LLM API bill, and which ones actually move the total.
-
How tokenization works, and why every model counts your text differently
Byte-pair encoding, vocabulary size, and why the same paragraph is 180 tokens for GPT-4o and 210 for Claude. What drives token count up, and how to write prompts that tokenize efficiently.
-
Why output tokens cost 3-5x more than input tokens
The prefill/decode split explained: why reading your prompt is cheap and parallel while generating a reply is expensive and sequential, and what that means for how you design prompts.
-
The hidden cost of chatbots: why multi-turn conversations grow quadratically
Chatbots resend the whole conversation on every turn, so cost scales with the square of the turn count. The maths, a worked example, and five ways to flatten the curve.
-
Prompt caching: how it works at OpenAI, Anthropic and Google
A practical guide to prefix caching — what gets cached, the discounts and TTLs at each provider, why cache writes can cost more than a normal call, and how to structure prompts so caches actually hit.
-
Context windows: limits, costs, and why bigger is not better
What a context window physically is, what happens when you exceed it, why retrieval accuracy degrades long before the limit, and how to decide how much context to actually send.
-
Reasoning models: why your bill is 2-5x the token count you estimated
Reasoning models like o3 and o4-mini generate hidden chain-of-thought tokens that you pay for as output but never see. How to estimate and control the invisible half of the bill.
-
LLM gateways vs direct API access: when the markup is worth it
OpenRouter, Together AI, Groq, Fireworks and LLM Gateway compared against going direct — on price, latency, reliability, model availability and operational overhead.
-
Self-hosting LLMs: working out the real break-even point
GPU rental rates, VRAM requirements, quantisation trade-offs and utilisation maths — a framework for deciding whether running an open-weights model yourself is actually cheaper than an API.
Where to start
If you are new to LLM billing, read LLM API pricing explained first, then how tokenization works. Together they cover everything you need to read a rate card correctly.
If you are already running something in production and want to cut the bill, skip to prompt caching and multi-turn conversation costs — between them they account for the large majority of avoidable spend in chat-shaped applications.
If you are choosing infrastructure, compare gateways against direct API access and read the self-hosting break-even analysis before committing to GPUs.