Most API budgets are written for a single prompt. Agent work is not a single prompt. A 20-step loop re-sends its whole working context twenty times, and every one of those sends is billed as input tokens. That is the line item that quietly turns a "cheap" model into an expensive month.
This post walks through what actually gets billed in a loop, puts a formula on it, and prices a 20-step run on four models against the marketplace snapshot from 29 November 2026.
What gets billed on each step
An agent turn is usually three things: a system prompt, the accumulated conversation and tool results, and the model's reply. The reply is output tokens. Everything you send is input tokens, including the parts you already sent on the previous nineteen steps.
Two consequences follow directly. First, cost grows roughly with the square of step count, not linearly: step n re-bills everything up to n .…