Factimonious®

AI Tokenomics in a Minute

Tokens

What tokens are in LLM APIs, how input and output differ, and why token counts drive coding-agent cost.

In one sentence

A token is a model’s billing and context unit for pieces of text (and sometimes other modalities)—not exactly a word, and not free.

Why it matters

Coding agents spend tokens on prompts, files, tool results, and completions. Misunderstanding tokens makes cost and context-limit surprises look like mysteries.

How it works

  • Providers tokenize text into subword pieces; counts vary by model family.
  • Input tokens cover what you send (system prompts, files, tool output).
  • Output tokens cover what the model generates.
  • Some products expose cached, reasoning, or other token classes with different prices.
  • Context windows limit how many tokens can be present at once; growth raises both cost and truncation risk.

Example

A short English sentence might be ~10–20 tokens depending on the tokenizer. A 2,000-line source file pasted into context can be thousands of tokens—and may be re-sent on every turn unless caching or compaction applies.

What this proves

Token counts from a provider prove how that provider billed or measured a request under its tokenizer and product rules.

What this does not prove

Token spend does not prove task success, code quality, or that a cheaper model would have failed.

Last reviewed 2026-09-06. Title for citation: AI Tokenomics in a Minute: Tokens.