Token problems: 9 of 20

By Prof. Tom Yeh

Published: 2026-05-28

URL: https://www.byhand.ai/p/library-agents-tokens-input-plus-output


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

Why does the same token count sometimes cost more? Because input and output are billed separately, at different rates. Input is read in a single pass; output is generated one token at a time, which is the expensive part. An agent that writes long replies will always cost more than one that reads the same amount and answers briefly.

Problem

An AI agent sends 600 input tokens and receives 200 output tokens. Input is priced at 2 cents per 100 tokens; output is priced at 8 cents per 100 tokens. What does the call cost in total?

Cost of the input tokens

Cost of the output tokens

Add the two costs

Practice 1

An AI agent sends 1,000 input tokens and receives 500 output tokens. Input is priced at 2 cents per 100 tokens; output is priced at 8 cents per 100 tokens. What does the call cost in total?

Cost of the input tokens

Cost of the output tokens

Add the two costs

Practice 2

An AI agent sends 400 input tokens and receives 300 output tokens. Input is priced at 2 cents per 100 tokens; output is priced at 8 cents per 100 tokens. What does the call cost in total?

Cost of the input tokens

Cost of the output tokens

Add the two costs


Next: 10. End-to-End Call Cost