AI token cost
calculator
See what a coding task costs in API tokens on Claude, GPT and Gemini models, and what the same work would cost on every other model.
How it works
Cost per task = fresh input tokens x input price + cached input tokens x cached price + output tokens x output price, all per million tokens. Prices are the standard API tier from each vendor's official pricing page, the same data as our AI coding price index. Cache write charges, batch discounts and fast modes are left out. The examples are rough sizes to start from, not measurements.
Questions
How do you calculate the cost of AI tokens?
Multiply each kind of token by its price per million and add them up: fresh input tokens times the input price, cached input tokens times the cached price, and output tokens times the output price, then divide by 1,000,000. This calculator does that for every model at once.
Why do cached tokens matter so much for coding?
AI coding tools resend the same files and conversation on every step, and most of that is served from the prompt cache at a fraction of the input price. In a long session the cached share is often well above half, which can cut the bill several times over.
How many tokens does a coding task use?
It varies a lot. A small fix can be a few tens of thousands of tokens, a long session several million, mostly input. The presets are rough examples to start from. Jenzo records the real number for every ticket your AI coding tools work on.
Do these prices match what I pay on a subscription?
No. Subscriptions like Claude Max or ChatGPT Pro charge a flat monthly price with usage limits. This calculator shows API prices, which is what you pay on your own API key or for usage billed at API rates.