Token problems: 10 of 20

By Prof. Tom Yeh

Published: 2026-05-28

URL: https://www.byhand.ai/p/library-agents-tokens-a-call-end-to-end


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

How do you price a call when you only know the word count? Estimate input tokens from the words, then price input and output separately. Get the token counts right and the cost follows. In practice, agent prompts arrive as natural language, so word-to-token estimation is the first step in any cost calculation.

Problem

An AI agent receives a 200-word prompt and returns 200 output tokens. Input tokens are estimated at 1.5 per word. Input is priced at 2 cents per 100 tokens and output at 8 cents per 100 tokens. What does the call cost in total?

Estimate the input tokens

Cost of the input tokens

Cost of the output tokens

Add the two costs

Practice 1

An AI agent receives a 100-word prompt and returns 600 output tokens. Input tokens are estimated at 2.0 per word. Input is priced at 2 cents per 100 tokens and output at 8 cents per 100 tokens. What does the call cost in total?

Estimate the input tokens

Cost of the input tokens

Cost of the output tokens

Add the two costs

Practice 2

An AI agent receives a 200-word prompt and returns 100 output tokens. Input tokens are estimated at 2.5 per word. Input is priced at 2 cents per 100 tokens and output at 8 cents per 100 tokens. What does the call cost in total?

Estimate the input tokens

Cost of the input tokens

Cost of the output tokens

Add the two costs


Next: 11. Comparing Three Calls