The math behind the switch
Switching pays off when savings on future work exceed the extra cost of processing the existing context on a different model.
Compare only the work ahead
Let A be the current model and B a different replacement model. Continuing with A keeps its warm cache; choosing A again is not a model switch and has no switching cost. Past spending is a sunk cost. Compare what both paths would cost from the switching point onward, assuming the same useful work and token usage.
The closed-form equations below assume fixed prices and full prefix reuse after B’s initial miss. Provider exceptions are handled by summing each generation’s charges.
- H
- Existing input context carried into the new model.
- T
- Output tokens generated after switching, including reasoning.
- U, W, R
- Cumulative ordinary input, new cache writes, and later warm-cache reads. The first processing of H is counted separately: a read on A, a write on B. W includes only newly added cached input.
- i, w, r, o
- Prices per million tokens for input, cache writes, cache reads, and output. Subscripts identify the model.
Stay with A
Switch to B
On the first generation, B replaces a cached read of H with a cache write. Input, cache-read, and cache-write charges are mutually exclusive: a write price is the total price, never an extra fee on top of ordinary input.
The break-even condition
Define Δp = pA − pB for each price category. Savings on future output, new input, and later cache reads are:
The upfront switching overhead is B’s initial write minus the read you would pay for on A:
Net savings = S(T) − P. Equality is break-even.
A threshold in generated tokens
If the input mix is approximately constant, define α = U / T, β = W / T, and γ = R / T. These describe how much input, writing, and reading accompanies each generated output token.
Approximate output tokens needed to break even
For a positive overhead P and positive denominator, generating more than this threshold makes switching cheaper. If the denominator is zero or negative, a positive overhead cannot be recovered under that fixed mix. If the overhead is nonpositive, compare the full inequality S(T) > P directly. In a growing conversation these ratios change, so the calculator evaluates successive output checkpoints instead.
Why context reuse matters
The two token sliders alone cannot determine an agent’s cost: the frequency of context reads matters too. The same 32k output tokens can require very different input bills. An agent that rereads a growing history every 1k output tokens pays for many more reads than one that generates 8k tokens between reads.
For output chunks of q tokens, let N = ⌈T / q⌉ be the number of context reads. If each read introduces u ordinary input tokens and g new cache-write tokens, the ideal warm-cache totals are:
The calculator sums the actual charge for each generation. It applies provider-specific cache minimums, documented long-context price changes, and partial final output. Its “break-even output” is the first cheaper completed generation checkpoint within 256k output tokens, not a guarantee that every later checkpoint will be cheaper.
Current scenario in numbers
Provider pricing and cache rules
Fourteen current presets keep the choices manageable. Prices are USD per 1,000,000 tokens; the sliders use 1k = 1,024 tokens. All prices are editable. Editing creates a custom model with fixed rates and ideal prefix reuse.
- OpenAI · 4 models. GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna. Standard tier, 30-minute cache writes; higher rates above 272,000 input tokens. Pricing · Caching.
- Anthropic · 4 models. Claude Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5. Default 5-minute writes. Haiku’s higher rates apply above 100,000 input tokens. Pricing · Caching.
- Google · 3 models. Gemini 4 Argon, Gemini 3.8 Flash, Gemini 3.1 Pro Preview. Implicit caching, so no explicit storage charges. Argon’s promotional prices run through Nov 30, 2026; Flash’s through Dec 31, 2026. Argon reprocesses the last 2,050 prefix tokens when fewer than 2,050 tokens are added; that rule is included. Pricing · Caching.
- xAI · 3 models. Grok 4.7, Grok 4.6, Grok Build 0.1. Automatic caching, with misses priced as ordinary input; higher rates at 200,000 input tokens or more. Pricing · Caching.
What this does—and does not—predict
This is a token-cost comparison, not a model quality ranking. It assumes the same future token counts and successful work on both models. Different tokenizers, reasoning budgets, retries, and tool use can change those counts. Eligible prefixes are assumed to hit; eviction, expiry, compaction, and changed instructions are not simulated. Provider-specific cache behavior can make the actual billed counts differ from the ideal formulas above.
Tool fees, regional premiums, explicit cache storage, latency, and past spending are excluded. Context limits are flagged when known, but the calculator does not simulate truncation or compaction. Prices were checked on November 5, 2026; they are a snapshot, not a live feed.