What Are AI Tokens and Why Do They Cost Money?

By Oversite Editorial Team Published

Every AI API charges per token. If you’re building with GPT-4o, Claude, Gemini, or any other model, your bill is measured in tokens. Here’s what that actually means and how to estimate your costs.

Tokens Are Word Pieces

A token is not a word. It’s a chunk of text — roughly 3/4 of a word on average. The word “artificial” is two tokens (“artific” + “ial”). The word “cat” is one token. A space before a word is usually part of the token.

ELI5: Tokens — Imagine cutting a sentence into puzzle pieces. But instead of cutting between words, you sometimes cut words in half too. “I love hamburgers” becomes four pieces: “I”, ” love”, ” ham”, “burgers”. Each piece is a token. AI models read and write in tokens, and you pay for each piece they process.

Rough conversion rules:

  • 1 token ≈ 4 characters in English
  • 100 tokens ≈ 75 words
  • 1,000 tokens ≈ 750 words (about 1.5 pages)
  • A typical blog post (1,500 words) ≈ 2,000 tokens

Non-English languages use more tokens per word. Chinese, Japanese, and Korean can use 2-3x more tokens than English for the same meaning, because the tokenizers were primarily trained on English text.

Input Tokens vs. Output Tokens

AI APIs charge differently for reading and writing:

  • Input tokens = what you send to the model (your prompt, context, documents)
  • Output tokens = what the model generates back (the response)

Output tokens are typically 2-5x more expensive than input tokens. This is because generating text requires more computation than reading it.

ModelInput (per 1M tokens)Output (per 1M tokens)
GPT-4o$2.50$10.00
Claude Sonnet 4$3.00$15.00
Claude Opus 4$15.00$75.00
Gemini 2.0 Pro$1.25$5.00
Llama 4 (via API)$0.20$0.60

Prices as of March 2026. See our full API pricing comparison for current rates.

Why Models Charge Per Token

The economics are straightforward: every token requires computation. Each token passes through billions of neural network parameters. More tokens = more GPU time = more cost.

This is why context window size matters for your bill. If you send a 100,000-token document as context with every API call, you’re paying for those input tokens every single time — even if your actual question is only 20 tokens.

ELI5: Context Window — The context window is how much text an AI can “see” at once. Think of it like a desk — a bigger desk lets you spread out more papers while working. GPT-4o’s desk holds about 128,000 tokens (roughly a 300-page book). Claude’s desk holds 200,000 tokens. If your document is bigger than the desk, some of it falls off and the AI can’t see it.

How to Estimate Your Costs

Step 1: Count your tokens. Use OpenAI’s tokenizer tool or Anthropic’s token counter. Paste your typical prompt and see how many tokens it uses.

Step 2: Estimate volume. How many API calls per day? Per month? What’s the average input and output length?

Step 3: Do the math.

Example: A customer support chatbot using GPT-4o

  • Average input: 2,000 tokens (system prompt + conversation history + user message)
  • Average output: 300 tokens (response)
  • Volume: 1,000 conversations/day

Monthly cost:

  • Input: 2,000 × 1,000 × 30 = 60M tokens × $2.50/M = $150
  • Output: 300 × 1,000 × 30 = 9M tokens × $10.00/M = $90
  • Total: ~$240/month

Switch to Claude Haiku or GPT-4o-mini and that drops to under $20/month — with slightly lower quality.

How to Reduce Token Costs

Use shorter system prompts. That 2,000-token system prompt is sent with every API call. Trimming it to 500 tokens cuts 75% of your input cost on that portion.

Choose the right model for the task. Don’t use Opus 4 for tasks that Haiku handles fine. Use big models for complex reasoning and cheap models for classification, extraction, and simple Q&A.

Cache your prompts. Anthropic offers prompt caching that reduces costs by up to 90% when you reuse the same system prompt or large document across calls. OpenAI has similar features.

Summarize long contexts. Instead of passing an entire 50-page document with every call, summarize it once and pass the summary. Reduces input tokens by 10-20x.

ELI5: Prompt Caching — Imagine you’re in a classroom and the teacher reads the textbook chapter out loud before every question. Boring and wasteful, right? Prompt caching is like the teacher reading it once and then remembering it for all future questions. You still pay for the first read, but every question after that is much cheaper because the AI already has the chapter “loaded.”

Token Limits and Truncation

Every model has a maximum context window — the total tokens (input + output) it can handle in one call. If you exceed it, most APIs will either truncate your input (cutting off the beginning) or return an error.

Common limits:

  • GPT-4o: 128K tokens
  • Claude Opus 4: 200K tokens
  • Gemini 2.0 Pro: 1M tokens (largest available)
  • Llama 4: 128K tokens

For most applications, you’ll never hit these limits. But for document analysis, long conversations with extensive history, or code review of entire repositories, context window size becomes a practical constraint.

The Takeaway

Tokens are the currency of AI APIs. Understanding them helps you:

  1. Estimate costs before building
  2. Optimize spending by choosing the right model and prompt design
  3. Avoid surprises on your monthly bill

API pricing has dropped approximately 90% since 2023, and it continues to fall. What cost $100/month two years ago costs $10/month today for the same task. The trend is toward cheaper tokens, bigger context windows, and more capable small models.

For current pricing across all major models, see our API Pricing Comparison.