Token problems: 8 of 20

By Prof. Tom Yeh

Published: 2026-05-28

URL: https://www.byhand.ai/p/library-agents-tokens-inputs-share


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

Are all the tokens in a call billed the same way? No. Every token is either input (what you send) or output (what the model generates), each billed at its own rate. The boundary between them is the dividing line between two different prices. Labeling each token is the first step to seeing where an agent's cost comes from.

Problem

A model receives the question what is the plan and replies first gather data then analyze results. Label each token I for input or O for output.

Label each token I or O

Count the tokens of each kind

Practice 1

A model receives the task summarize the meeting notes and replies the team agreed to ship by Friday. Label each token I for input or O for output.

Label each token I or O

Count the tokens of each kind

Practice 2

A model receives the request list the tasks assigned to Alice and replies Alice has three open tasks. Label each token I for input or O for output.

Label each token I or O

Count the tokens of each kind


Next: 9. The Two-Part Bill