AI Term

What is Token?

A unit of text that AI language models process—roughly equivalent to about 4 characters or 0.75 words in English. Tokens determine context limits and pricing.

In the context of AI language models, a token is a unit of text that the model processes. Understanding tokens is essential for working with AI effectively and managing costs.

What Is a Token?

A token is roughly:

  • 4 characters of English text
  • About 0.75 words
  • Sometimes a whole word, sometimes a part of a word
  • The word "hamburger" might become two tokens: "ham" and "burger"

    The phrase "I love AI" is 3 tokens

    Why Tokens Matter

    Context Windows

    Every AI model has a maximum number of tokens it can process at once. This includes both your input and the model's output.

    | Model | Context Window |

    |-------|---------------|

    | GPT-3.5 | 16K tokens (~12,000 words) |

    | GPT-4 | 128K tokens (~96,000 words) |

    | Claude | 200K tokens (~150,000 words) |

    Pricing

    API usage is typically charged per token. Both input and output tokens count toward your bill.

    Response Limits

    Longer prompts leave less room for responses. A very long input may result in truncated outputs.

    Token Counting

    Different models tokenize text differently. A sentence that's 20 tokens in GPT-4 might be 22 tokens in another model.

    Tools exist to count tokens before sending to an API, helping you stay within limits and estimate costs.

    Practical Implications

    For Users

  • Very long conversations may hit limits
  • Complex prompts consume tokens from response capacity
  • Including unnecessary context wastes tokens
  • For Developers

  • Token limits affect application design
  • Costs scale with token usage
  • Efficient prompting saves money
  • Tips

  • Be concise without sacrificing clarity
  • Remove redundant examples and context
  • Use summaries instead of full documents when possible
  • Monitor token usage for cost management
  • Examples

    Context window limitsAPI pricingMessage length limits

    Want to learn more AI terms?

    Browse All Terms