TokenSave logo TokenSave
API prices updated daily · plan prices checked October 2026

Coding agent cost calculator

What do Claude Code, Codex or Gemini CLI cost per month on the API, and is a subscription cheaper?

Mostly chatting with ChatGPT, Claude or Gemini? Use the subscription vs API calculator →

How you use coding agents

Not sure? Pick a profile
Typical task
22
Prompt caching
Tokens per month Input 0 Output 0

An agent re-sends its whole working context on every step: system prompt, tools, the files it has read and earlier steps. So one task can use hundreds of thousands of input tokens. With caching, repeated context is billed at about 10% of the input price.

How much does Claude Code cost per month?

On Claude Pro or Max you pay the plan price ($20, $100 or $200) within its usage limits. On the API you pay per token: with caching, a typical feature task on Sonnet costs about $0.70, so 10 tasks a day come to roughly $150 a month.

Why do coding agents use so many tokens?

Every step sends the whole context again: system prompt, tool definitions, files the agent has read and all earlier steps. A 25-step task can send over a million input tokens, even if the code it writes is short.

Subscription or API for coding agents?

For a few small tasks a day the API is usually cheaper. For heavy daily use a $100–200 plan often costs less than the API would, as long as you stay within its limits.

How to use the agent cost calculator

  1. Choose a typical task size: a small fix, a feature, or a big change.
  2. Set how many tasks you run per day and how many days a month.
  3. Leave prompt caching on unless your tool does not use it.
  4. Compare the monthly API cost of each model with the Claude and ChatGPT plans that include an agent.

How it is calculated

An agent works in steps, and every step sends its whole working context back to the model. The calculator models a task as a number of steps with a starting context, a fixed amount of new context per step and a fixed output per step: a feature task is 25 steps starting at 22,000 tokens, adding 3,500 per step and writing 700 per step. With caching on, the repeated part of the context is billed at 10% of the input price. Contexts are capped at 180,000 tokens, as agents compact long sessions.

Tips

Guide