Token problems: 16 of 20
By Prof. Tom Yeh
Published: 2026-05-28
URL: https://www.byhand.ai/p/library-agents-tokens-tokens-on-a-budget
Token problems: the workbook
- Tokens on a Budget
Given a budget, how many tokens can one call afford? The earlier pricing problems ran forward: tokens in, cost out. This one runs backward: cost in, tokens out. Divide the budget by the price per block, then scale up to tokens. Agents with per-call cost limits use this calculation to set a maximum context size before each turn.
Problem
You have a budget of 50 cents for one call. The model is priced at 2 cents per 100 tokens. How many tokens can the call use?
How many 100-token blocks the budget buys

Convert the blocks to tokens

Practice 1
You have a budget of 90 cents for one call. The model is priced at 3 cents per 100 tokens. How many tokens can the call use?
How many 100-token blocks the budget buys

Convert the blocks to tokens

Practice 2
You have a budget of 60 cents for one call. The model is priced at 4 cents per 100 tokens. How many tokens can the call use?
How many 100-token blocks the budget buys

Convert the blocks to tokens
