AI Agent Cost Simulator

AI Agent Cost Simulator

See how an agent's run-cost compounds as its context grows — and where it slams into a model's price cliff.

—Total tokens processed
—Final run cost
—Waste vs cheapest alternative

How the agent cost simulator works

An agent loop re-sends its whole conversation on every step: the system prompt, tool definitions and task (base tokens), plus everything earlier steps appended, such as tool results and the model’s own replies (added per step). Step n therefore sends roughly base + n × added tokens of input, and the run’s total input grows with the square of the number of steps, not in a straight line.

Prompt caching softens that: the repeated prefix is billed at the model’s cached-input rate (often 2–10% of the normal input price) and only the newly appended tokens pay full price. The simulator assumes the prefix is cached on every step, and that the model’s reply is about a fifth of what each step appends.

Where the price cliff comes from

Some models bill a whole request at a higher rate once a single prompt passes a size threshold: GPT-5.5 and the GPT-6 family above 272K tokens, Grok 4.x and Gemini 3.1 Pro above 200K, and Claude Haiku 5.5 above 100K. The threshold applies to each request on its own, so a long-running agent crosses it on the step where its context first exceeds the limit, and every later step pays the premium. The chart turns red from that step.

Using the inputs

  1. Model and Compare with: prices load live from the YemHub pricing index, which is checked against each provider’s own price page.
  2. Base tokens: what every request starts with (system prompt, tool schemas, task, retrieved files).
  3. Added / step: what one step appends (tool output plus the model’s reply).
  4. Steps: how many turns the agent takes, up to 500.

The “wasted” figure compares your model with the cheapest model whose context window fits the largest single request. For a one-off request with batch, cache and tool fees broken out, use the AI cost calculator; for how prices have moved, see daily pricing changes.