How LLM API pricing works
Every provider here bills by the token, a chunk of text that is often a whole short word and sometimes a piece of a long one. Prices are quoted per million tokens, and each request is billed in three parts:
- Input tokens: everything you send. That is the system prompt, the conversation so far, any documents or retrieved passages, tool definitions and the user's message.
- Output tokens: everything the model writes back, including hidden reasoning on models that think before answering. Output costs about three to six times as much as input across the models in the table.
- Cached input tokens: the part of your input that repeats from an earlier request, such as a fixed system prompt. Providers bill it at a fraction of the input price, typically a tenth or less.
Cost per request = fresh input × input price+ cached input × cached price+ output × output price
Batch processing is the other big lever. OpenAI, Anthropic and Google all take 50% off when you submit requests as a batch and accept results within about a day. DeepSeek publishes no batch price but charges half during its off-peak hours; the table shows its peak price to stay on the safe side.
A worked example
The calculator opens on the chatbot preset: 1,500 input tokens per reply, half of them a cached system prompt, 350 output tokens, and 1,000 replies a day. On Claude Sonnet 5.5, at $2 input, $0.10 cached and $10 output per million tokens:
750 × $2 + 750 × $0.10 + 350 × $10 = $5,075 per million requests= about half a cent a reply, $5 a day, $152 a month
Two things stand out. Output is under a fifth of the tokens but about 70% of the bill. And caching earns its keep: without it, the same traffic costs $195 a month. On GPT-6 Luna or Claude Haiku 5.5 the identical workload is under $8 a month, which is why picking the right model size matters more than any other setting.
How to estimate tokens
The usual rule of thumb for English is that a token is about three quarters of a word, so 100 tokens is roughly 75 words, or about four characters per token. Google's documentation gives the same four-character figure. It drifts in predictable ways:
- Code and data use more tokens per character than prose, because brackets, indentation and long identifiers split into many small pieces. JSON with repeated keys is a common surprise.
- Other languages often need more tokens per word than English, and scripts like Chinese, Japanese or Hindi can need far more per character. DeepSeek's docs put an English character at about 0.3 tokens and a Chinese character at about 0.6.
- Each provider's tokenizer differs. Anthropic notes that its current models' tokenizer produces about 30% more tokens than its earlier ones for the same text, so the same prompt has a different token count, and price, on each provider.
- Hidden tokens add up. Chat history grows with every turn, tool definitions ride along on every request, and reasoning models add their thinking to the output side. Count what you actually send, not just what the user typed.
Paste a real prompt into the box above to see this for your own text. The OpenAI figure is counted in your browser with the o200k_base tokenizer; the others are labeled approx. because they come from each provider's published ratio.
6 ways to cut your API bill
- Cache the repeated part. Put the fixed system prompt, tool definitions and shared documents at the start of every request so the provider can cache them. Cached tokens cost a tenth or less of fresh ones.
- Batch anything that can wait. Nightly classification, report drafts and evaluations rarely need an answer in seconds. Batch halves the price at three of the four providers.
- Route by difficulty. Send every request to a small model first and escalate only the hard ones. The cheapest and most expensive models in the table differ by about 80 times for the same tokens.
- Shorten the system prompt. Every token in it is paid on every request. Cutting 1,000 tokens from a prompt sent a million times a month removes a billion input tokens.
- Limit the output. Set a maximum output length, ask for the format you need instead of an essay, and turn reasoning effort down on simple tasks. Output is the most expensive token you buy.
- Retrieve instead of stuffing. Long context windows make it tempting to send whole manuals with each question. Sending only the five most relevant passages usually answers as well for a fraction of the input.
API or a chat subscription?
Consumer plans such as ChatGPT Plus and Claude Pro are flat monthly fees for a person using the provider's own apps, with features like file uploads, memory and voice built in. The API is pay-per-token access for software you build: your product, scripts and automations call the model directly, and you pay only for what runs.
| Question | Chat subscription | API |
|---|---|---|
| Who uses it | You, in the provider's app | Your software and its users |
| How you pay | Flat monthly fee with usage limits | Per token, no fixed fee |
| Best for | Daily personal work: writing, research, coding help | Products, automations and anything that runs without you |
| Watch out for | Limits at busy times; not meant to power a product | Costs grow with traffic, so estimate before launch |
Plenty of teams use both: subscriptions for the people, the API for the product. Plan prices change often, so check them on the providers' own pages.
What the presets assume
- Chatbot reply: 1,500 input tokens (system prompt plus recent turns, half cached), 350 output, 1,000 a day.
- RAG answer: 6,000 input tokens (instructions, five retrieved passages and the question, 15% cached), 500 output, 500 a day.
- Summarize a 20-page PDF: about 12,000 words of text, 16,000 input tokens, a 1,000-token summary, 20 a day.
- Agent step: 20,000 input tokens of tools, instructions and history (85% cached), 800 output, 2,000 steps a day.
- Classify 10k rows: 300 input tokens per row (70% shared instructions), a 10-token label, 10,000 rows a day, sent as a batch.