Token Usage & Cost
My API bill blew up this month. What am I actually paying for?
My API bill blew up this month. What am I actually paying for?
These rounds and Token counts are illustrative.
Every round brings along needed rules, history, and new results; cost is not just the final answer.
Every turn has input: Rules, chat history, files, and tool results may enter the model again each turn.
Every turn has output: Responses, next-step suggestions, and tool requests also produce output tokens.
Calculate each token category separately: Add input, output, cache, and model categories, then apply the matching rates.
Report each Agent round's input, output, cached tokens, model, and estimated cost, marking repeated history and large tool results. Remove irrelevant context before considering a cheaper model, and never count only new user text.
Build in 3D. Put your computer to work.