Token problems: 6 of 20

By Prof. Tom Yeh

Published: 2026-05-28

URL: https://www.byhand.ai/p/library-agents-tokens-the-price-of-a-call


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

What does a model API call cost? Every call is billed by the token: count the 100-token blocks in the call, then multiply by the price per block. Real APIs quote per million tokens, but these problems use cents per 100 to keep the arithmetic easy to follow by hand. An agent that calls the model on every user turn pays this cost each time.

Problem

An AI agent processes a call of 600 tokens. The model is priced at 2 cents per 100 tokens. What does this call cost?

Count the 100-token blocks

Multiply by the price per block

Practice 1

An AI agent processes a call of 2,000 tokens. The model is priced at 3 cents per 100 tokens. What does this call cost?

Count the 100-token blocks

Multiply by the price per block

Practice 2

An AI agent processes a call of 800 tokens. The model is priced at 5 cents per 100 tokens. What does this call cost?

Count the 100-token blocks

Multiply by the price per block


Next: 7. Two Kinds of Token