Quick Answer
A token is a chunk of text, roughly ¾ of a word on average. AI models read text as tokens, charge you per token, and have a maximum number of tokens they can handle at once. When you see “cost per 1M tokens” or “128K context window,” this is what they mean.

Why tokens exist

Computers don’t read letters the way you do. Before an AI model can process your message, it needs to convert your text into numbers. Tokenization is that conversion: breaking text into pieces the model can work with.

The word “hello” might be one token. The word “tokenization” might be three tokens: “token”, “ization”. A space before a word often gets included in the token. Punctuation is usually its own token.

The exact split depends on the tokenizer, and different AI models use different ones. But the rough math holds: 1 token ≈ 4 characters ≈ ¾ of a word.

Why this matters for your wallet

AI companies charge per token. When you see pricing like:

ModelInputOutput
GPT-4o$2.50 / 1M tokens$10 / 1M tokens
Claude Sonnet$3 / 1M tokens$15 / 1M tokens

…this is what they mean. You pay for:

  • Input tokens: Everything you send to the model (your question, any documents you paste, the system prompt)
  • Output tokens: Everything the model generates back (usually more expensive because generation is harder than reading)

A typical short conversation might use 500 input tokens and 300 output tokens. That’s fractions of a cent. But if you’re building an app that sends a 10-page document to Claude every time a user asks a question, and you have 1,000 users per day, the math changes fast.

Quick token math

  • 1 page of text ≈ 500 tokens
  • A typical email ≈ 200-400 tokens
  • “What’s the weather?” ≈ 5 tokens
  • A detailed system prompt ≈ 500-2,000 tokens
  • An entire novel ≈ 100,000+ tokens

You can check exact token counts using OpenAI’s tokenizer tool or Anthropic’s token counter in the API response.

The context window limit

Every model has a maximum number of tokens it can handle at once, called the context window:

ModelContext window
GPT-4o128,000 tokens
Claude Sonnet/Opus200,000 tokens
Gemini 1.5 Pro2,000,000 tokens

This limit includes both input AND output. If you’re at 195,000 tokens and ask for a 10,000 token response, you’ll hit the wall.

When you exceed the context window:

  • The API returns an error
  • Or the model “forgets” the oldest messages to make room
  • Or your request just fails silently

This is why apps that work with documents need strategies like chunking (splitting documents into pieces) or RAG (only retrieving relevant sections).

Why your vibe coding costs add up

Common token traps for vibecoders:

Huge system prompts: If you paste your entire codebase into the system prompt “for context,” you’re paying for that on every single message.

Asking for long responses: “Explain everything in detail” costs more than “Give me a one-sentence summary.”

Using expensive models for simple tasks: GPT-4o is overkill for “Is this email spam? Yes or no.” A smaller, cheaper model works fine.

Not caching: If 10,000 users ask the same question, you pay for the AI to answer it 10,000 times. Caching identical responses saves money.

What to do about it

  1. Know your costs: Check your AI provider’s dashboard. See what’s actually costing money.

  2. Right-size your model: Use cheap models for simple tasks, expensive models for hard ones.

  3. Be specific: “Summarize in 2 sentences” costs less than “Tell me everything about this.”

  4. Cache when possible: If the same input always produces the same output, cache it.

  5. Use retrieval: Don’t send entire documents. Retrieve only the relevant chunks.

Further reading