Blog

LLM API pricing explained: how tokens turn into a bill

Prices checked Nov 26, 2026 · 4 min read

LLM API pricing explained: input and output tokens priced per million

LLM API pricing is per token. You pay one rate for the tokens you send (input) and a higher rate for the tokens the model writes back (output). Both are quoted per 1M tokens. The bill for one request is input tokens x input rate + output tokens x output rate, divided by 1,000,000. That formula covers every chat model on TapModels, from Claude Haiku 5.5 at $0.06 in and $0.30 out to Claude Fable 5 at $4.00 in and $20.00 out. Below we run it with real numbers, so you can predict your own LLM cost before you ship.

What a token is, and why price is per million

A token is the unit a model reads and writes, often a short word or part of one. In English, a rule of thumb is about 4 characters per token, so 1,000 tokens is roughly 750 words. That is only an estimate, since code, other languages and emoji split differently. The real count comes back in the usage field of each response, and the token counter estimates it before you send.

One token costs a tiny fraction of a cent, so providers quote prices per 1M tokens to keep the numbers readable. $0.80 per 1M tokens is $0.0000008 per token.

Input tokens and output tokens

Every request has two parts, and each is priced separately:

  • Input tokens are everything you send: the system prompt, the conversation so far, any documents you paste, and the new message.
  • Output tokens are everything the model writes back.

Output costs more. In our catalog:

ModelInput / 1MOutput / 1MOutput is
Claude Haiku 5.5$0.06$0.305x input
GPT-6.2 Sol$0.60$3.005x input
Claude Sonnet 5.5$0.80$4.005x input
Grok 4.7$0.80$2.403x input

The LLM price comparison has the full table for all nine models.

One request, worked out

A request to Claude Sonnet 5.5 sends 2,000 input tokens and gets 500 output tokens back.

  • Input: 2,000 / 1,000,000 x $0.80 = $0.0016
  • Output: 500 / 1,000,000 x $4.00 = $0.0020
  • Total: $0.0036, which is 0.36 credits (100 credits = $1)

That is less than half a cent. Cost only starts to matter at volume, so the next step is to multiply.

One month, worked out

Say that same request runs 100,000 times a month.

  • Input tokens: 100,000 x 2,000 = 200M. Cost: 200 x $0.80 = $160.00
  • Output tokens: 100,000 x 500 = 50M. Cost: 50 x $4.00 = $200.00
  • Total: $360.00 a month

Output is 20% of the tokens (50M of 250M) but 56% of the money ($200 of $360). Get the model to answer in 300 tokens instead of 500 and output drops to 30M, costing $120.00, so the monthly bill falls from $360.00 to $280.00. Cutting the same 200 tokens from the input saves only $16.00 (20M tokens at $0.80 per 1M). For cost, shorter answers beat shorter prompts.

Where the LLM cost creeps up

Four things push a bill above the first estimate:

  1. Conversation history grows. Chat APIs are stateless, so each turn resends the earlier messages and the input gets longer every time. A 10-turn chat costs far more than 10 times a single turn.
  2. System prompts repeat. You pay for a 1,500-token instruction block on every call.
  3. Retrieved context adds up. Pasting search results or documents into the prompt adds input tokens quickly.
  4. Reasoning and long answers cost output. Models that think step by step write more. Check the output count in usage on real requests instead of guessing.

Set max_tokens on every call. It caps the output side, which caps the worst case for each request.

Other units: images, video, speech

Most of the time, chat is the only category priced per token. On TapModels the other units are:

TypeUnitExample price
Imageper image, by resolutionNano Banana 2.1 at 1K: $0.02
Videoper second or per clipWan 3.0 at 720p: $0.08 per second
Speechper 1,000 charactersElevenLabs Turbo 2.5: $0.0375

Gemini 3.8 Flash TTS is the exception: it bills text input at $0.4375 and audio output at $7.875 per 1M tokens. Media tasks run asynchronously. Credits are held when you submit the task and charged only if it succeeds, so a failed task costs nothing.

Check a price before you run it

The fastest way to get a number you can trust is to test it. Send 10 real requests, read usage from each response, average the token counts, and multiply by the rates above. Repeat for two or three models. The LLM cost calculator does the multiplication for you.

curl https://api.tapmodels.com/v1/chat/completions \
  -H "Authorization: Bearer $TAPMODELS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Plan a zero-downtime migration of a 40M-row table."}], "max_tokens": 500}'

Once you have your numbers, pick a model from the cheapest LLM API ranking, or open the Claude Sonnet pricing page for the live rates.

Frequently asked questions

How is LLM API pricing calculated?

You pay for tokens. Each request has input tokens (your prompt and context) and output tokens (the reply). The price is quoted per 1M tokens, with a separate rate for each. Cost = input tokens x input rate + output tokens x output rate, divided by 1,000,000.

What is a token?

A token is a chunk of text a model reads or writes, often a short word or part of a word. A common rule of thumb for English is about 4 characters per token, but it varies by model and language. The usage field in each API response gives the exact count.

Why does output cost more than input?

Providers price generating text higher than reading it. In our catalog, output is 5 times the input price for eight of nine chat models, and 3 times for Grok 4.7. The multiplier is why long answers drive most of a bill.

Do image and video APIs also bill per token?

Usually not. Image models bill per image, video models per second or per clip, and text-to-speech per 1,000 characters. Gemini TTS is the exception in our catalog: it bills text input and audio output per 1M tokens.

Sources