Code modernization token estimator: repo size to tokens
Turn the size of a repository into the input and output tokens an agent needs to read and rewrite it, and the cost at your model price
Result
Estimated token cost
$70
- Tokens in the codebase
- 2,500,000
- Input tokens
- 20,000,000
- Output tokens
- 3,000,000
LLM API prices per 1M tokens
Standard prices for current Claude, GPT and Gemini models in US dollars per million tokens. Pick a model above to fill the calculator with its prices.
| Model | Provider | Input | Cached input | Output |
|---|---|---|---|---|
| Claude Fable 5.1 | Anthropic | $10.00 | $0.25 | $50.00 |
| Claude Opus 5.5 | Anthropic | $4.00 | $0.20 | $20.00 |
| Claude Sonnet 5.5 | Anthropic | $2.00 | $0.10 | $10.00 |
| Claude Haiku 5.5 Prompts up to 100K tokens | Anthropic | $0.10 | $0.01 | $0.50 |
| GPT-6 Astra Up to 272K input tokens | OpenAI | $10.00 | $1.00 | $50.00 |
| GPT-6.1 Sol Up to 272K input tokens | OpenAI | $2.00 | $0.10 | $10.00 |
| GPT-6.1 Terra Up to 272K input tokens | OpenAI | $1.00 | $0.05 | $5.00 |
| GPT-6 Luna Up to 272K input tokens | OpenAI | $0.10 | $0.01 | $0.50 |
| Gemini 4 Argon Introductory price until 30 Nov 2026, then $4 / $20 | $2.00 | $0.10 | $10.00 | |
| Gemini 3.1 Pro (preview) Prompts up to 200K tokens | $2.00 | $0.20 | $12.00 | |
| Gemini 3.8 Flash Introductory price until 31 Dec 2026, then $1.50 / $7.50 | $0.75 | $0.075 | $3.75 | |
| Gemini 3.5 Flash-Lite | $0.30 | $0.03 | $2.50 |
Prices checked on November 3, 2026 from the official pricing pages: Anthropic, OpenAI, Google. Batch, priority and regional pricing differ. Always confirm on the provider’s page before you budget.
How it is calculated
Code tokens = lines × tokens per line. Input tokens = code tokens × read passes (agents re-read files and context). Output tokens = code tokens × share rewritten × output overhead. Cost = input × input price + output × output price, per 1M tokens.
Keep in mind
The default prices are Claude Sonnet 5.5 list prices checked on 3 November 2026. Prices change, so confirm them on your provider’s pricing page.
Related service
Agent platform consultancy