Token problems: 4 of 20

By Prof. Tom Yeh

Published: 2026-05-28

URL: https://www.byhand.ai/p/library-agents-tokens-tokens-per-word


Token problems: the workbook

  1. Count the Tokens
  1. Subword Splitting
  1. Punctuation Counts
  1. Tokens per Word
  1. Will It Fit?
  1. The Price of a Call
  1. Two Kinds of Token
  1. Input or Output?
  1. The Two-Part Bill
  1. End-to-End Call Cost
  1. Comparing Three Calls
  1. The Average Call
  1. The System Prompt
  1. The System Prompt Tax
  1. Calls in a Budget
  1. Tokens on a Budget
  1. How Long Will It Take?
  1. The Split Matters
  1. Pricing per Million Tokens
  1. Tokens from the Bill

Does every language tokenize the same way? No. The ratio of tokens to words varies because tokenizers are trained mostly on English. Agents serving multilingual users will pay different costs for the same message depending on the language.

Problem

An AI agent processes a 20-word passage of English text and counts 26 tokens. What is the token-to-word ratio?

Divide tokens by words

Practice 1

An AI agent processes a 24-word passage of Spanish text and counts 36 tokens. What is the token-to-word ratio?

Divide tokens by words

Practice 2

An AI agent processes a 15-word passage of Hindi text and counts 45 tokens. What is the token-to-word ratio?

Divide tokens by words


Next: 5. Will It Fit?