Token problems: 15 of 20

By Prof. Tom Yeh

Published: 2026-05-28

URL: https://www.byhand.ai/p/library-agents-tokens-calls-in-a-budget


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

Given a fixed budget, how many calls can you make? Find the cost of one call first, then divide the budget by that cost. The result is the hard ceiling on how much work can be done in a session. For agents running autonomously, this ceiling determines how many steps the agent can take before it must stop.

Problem

An AI agent has a daily budget of 240 cents. Each call has 400 input tokens and 100 output tokens. Input is priced at 2 cents per 100 tokens; output at 8 cents per 100 tokens. How many calls can it make in a day?

Cost per call

Calls in the budget

Practice 1

An AI agent has a daily budget of 440 cents. Each call has 300 input tokens and 200 output tokens. Input is priced at 2 cents per 100 tokens; output at 8 cents per 100 tokens. How many calls can it make in a day?

Cost per call

Calls in the budget

Practice 2

An AI agent has a daily budget of 280 cents. Each call has 200 input tokens and 300 output tokens. Input is priced at 2 cents per 100 tokens; output at 8 cents per 100 tokens. How many calls can it make in a day?

Cost per call

Calls in the budget


Next: 16. Tokens on a Budget