Agent Switching Tokenomics

Switching models has a cost. Find out how many newly generated tokens it takes for a cheaper model to pay back a cold cache.

Choose your models

Edit token prices

USD per million tokens. Rates shown before long-context adjustments.

Token categoryCurrent model ANew model B
Input
Cache read
Cache write
Output

128k
1k256k512k

The prefix carried over to the new model, not all tokens spent so far.

32k
1k128k256k

1k = 1,024 tokens · move in 1k steps.

Context reuse & cache assumptions

An agent rereads its growing context between generations. These settings determine the input bill.

New writes can include prior output and tool results; they extend the cached prefix. Other input is not retained. A starts warm, B starts cold. All later eligible reads hit the cache.

Calculated locally

Standard pricing · Nov 5, 2026 · Sources & methodology

Calculating…

Stay with A
—
Switch to B
—
Break-even output
—

Cost as the agent keeps generating

StaySwitch
Cumulative cost after switchingCost comparison by newly generated output tokens.

Cost breakdown
Billed categoryStay with ASwitch to B
Total from here

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

rAH+iAU+wAW+rAR+oAT106

Switch to B

wBH+iBU+wBW+rBR+oBT106

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:

S(T)=ΔiU+ΔwW+ΔrR+ΔoT106

The upfront switching overhead is B’s initial write minus the read you would pay for on A:

P=(wB−rA)H106
Switch whenS(T)>P

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

Tbreak-even=H(wB−rA)Δo+αΔi+βΔw+γΔr

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:

U=uNW=gNR=H(N−1)+gN(N−1)2

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.

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.

Back to calculator