One Turn Through Nadir

One coding-agent turn followed through Nadir in four stages: the ask, the pick of model and effort, the cache check, and the call on your own keys. The agent asks for pagination on a users endpoint. Nadir picks the cheapest rung on the ladder that can do it, plus its effort. It checks whether the switch beats rebuilding a warm prompt cache, which pays on the first turn with a 12,000-token prefix and only from the third with 60,000. Then the agent makes the call on its own keys. Illustrative numbers throughout: $0.028 for the turn against $0.070 on the top model, at list prices.

Published 2026-10-20 by Dor Amir on the Nadir blog.

Filed under Nadir & Alternatives.

This post follows one turn of a coding agent through Nadir, from the moment the agent sends it to the moment the provider bills it. There are four stages. The agent asks. Nadir picks a model and an effort. Nadir checks whether switching models is worth giving up a warm prompt cache. Then the agent makes the call itself, on its own keys.

Every number in this post is illustrative: a made-up turn, list prices for a made-up three-rung ladder, and the arithmetic that follows from them. None of it was measured on customer traffic, and none of it is a savings forecast.

Four panels showing one coding-agent turn. Ask: the agent asks for pagination on the users endpoint, reads two files, adds 8,000 new tokens, with a 12,000-token warm cache. Pick: a ladder of top model at xhigh effort and $5 in / $25 out, mid model at medium effort and $2 / $10, small model with no effort parameter at $1 / $5, with the mid model picked. Check: warm on the top model with a 12,000-token cached prefix, the switch pays back on this turn, decision switch to mid. Call: this turn $0.028 against $0.070 on the top model, sent by your agent on your own sign-in or keys. All values illustrative.
Four panels showing one coding-agent turn. Ask: the agent asks for pagination on the users endpoint, reads two files, adds 8,000 new tokens, with a 12,000-token warm cache. Pick: a ladder of top model at xhigh effort and $5 in / $25 out, mid model at medium effort and $2 / $10, small model with no effort parameter at $1 / $5, with the mid model picked. Check: warm on the top model with a 12,000-token cached prefix, the switch pays back on this turn, decision switch to mid. Call: this turn $0.028 against $0.070 on the top model, sent by your agent on your own sign-in or keys. All values illustrative.

1. Ask: the agent sends a turn, as usual

You are in Claude Code, Codex or Cursor, and you type: "Add pagination to the users endpoint." The agent does what it always does. It reads the two files that matter, the route handler and the query layer underneath it, and builds a request out of the system prompt and tool definitions it carries on every call, the session so far, your ask, and the two files.

Two numbers about that request decide the rest of this post:

Nothing about the agent's workflow changes. Before the call goes out, a hook in the agent asks Nadir one question: which model should take this turn, and at what effort? It sends the prompt along with the session's cache state, meaning which model is warm and how big the cached prefix is.

2. Pick: the cheapest rung that can do the turn

A ladder is an ordered list of models, cheapest to most capable, set per API key. This example uses three rungs at list price, and prices this turn's 8,000 tokens in and 1,200 out on each:

Rung and effortPer 1M tokens, in / outThis turn
Top model, xhigh$5 / $25$0.070
Mid model, medium$2 / $10$0.028
Small model, none$1 / $5$0.014

Nadir's classifier reads the turn and scores how much model it needs. Price does not enter that score. Price only orders the ladder, and Nadir takes the cheapest rung that clears the score. For this turn that is the mid model. Pagination touches the endpoint's contract and the query under it, a two-file change with a real design choice in it (cursor or offset, what the default page size is). That is more than a rename and less than a cross-service refactor.

The small model would be cheapest, at $0.014, and for "rename this variable" or "fix this lint error" it is the right pick. Here it is a false economy. A weaker first attempt is a turn you pay for twice, once for the miss and once for the retry. The classifier is trained to treat sending a hard turn too low as the costlier of the two mistakes, so when it is unsure it leans up the ladder, not down.

Effort comes with the rung. Effort is how much the model reasons before it answers, and reasoning is billed as output tokens. Turns that land on the top rung are the ones that need deep reasoning, so it runs at xhigh. A mid-sized turn at medium effort does not spend reasoning tokens it has no use for. Some small models take no effort parameter at all, so that rung sends none.

The table holds output at 1,200 tokens on every rung to keep the arithmetic readable. In practice a model at xhigh effort writes more reasoning tokens than one at medium, so the flat figure flatters the top rung, not the mid one.

3. Check: switch only when it beats rebuilding the cache

The pick says mid. But the session is warm on the top model, and a prompt cache belongs to one model. The 12,000 cached tokens bill at a cache-read rate on the top model. The mid model has never seen them, so its first turn has to write them into its own cache at a cache-write rate, and the read discount the top model had already earned is gone. Your Router Is Fighting Your Prompt Cache works through that penalty in depth.

So before it answers, Nadir prices both paths over the turns the session is expected to have left:

It recommends the switch only when the switch path is cheaper. When it is not, the turn stays on the warm top model, which is at least as capable as the model the classifier picked and cheaper for the session as a whole.

With illustrative cache pricing, a read at 10% of the input price and a write at 125% of it (a common provider pattern), this turn looks like this:

First turnStay on top modelSwitch to mid model
12,000-token cached prefixread: $0.006write: $0.030
This turn's own tokens$0.070$0.028
Total$0.076$0.058

Rebuilding the cache costs $0.024 more than reading it, and the turn itself is $0.042 cheaper on the mid model. The switch pays for itself on the first turn. Decision: switch to mid.

That is the easy case. The check earns its keep when the warm prefix is large, and in a long coding session the carried context grows with every file read and tool result (The Prefix Tax covers why). Same turn, same prices, bigger prefix:

Warm prefixFirst turn, stay vs switchSwitch pays from
12,000 tokens$0.076 vs $0.058turn 1
30,000 tokens$0.085 vs $0.103turn 2
60,000 tokens$0.100 vs $0.178turn 3
120,000 tokens$0.130 vs $0.328turn 4
Two line charts of cumulative cost over six turns, staying on the warm top model against switching to the mid model. With a 12,000-token warm prefix the switch line is below the stay line from turn 1, ending at $0.210 against $0.456. With a 60,000-token warm prefix the switch line starts above, $0.178 against $0.100 on turn 1, crosses on turn 3, and ends at $0.378 against $0.600. Illustrative prices: top $5 / $25, mid $2 / $10 per 1M tokens, cache read 10% and cache write 125% of input.
Two line charts of cumulative cost over six turns, staying on the warm top model against switching to the mid model. With a 12,000-token warm prefix the switch line is below the stay line from turn 1, ending at $0.210 against $0.456. With a 60,000-token warm prefix the switch line starts above, $0.178 against $0.100 on turn 1, crosses on turn 3, and ends at $0.378 against $0.600. Illustrative prices: top $5 / $25, mid $2 / $10 per 1M tokens, cache read 10% and cache write 125% of input.

At 60,000 tokens the first turn on the mid model costs $0.178 against $0.100 for staying, and the switch only comes out ahead from the third turn. At 120,000 it takes four. If the session is about to end, say the agent is writing its last commit, the cheaper model never earns back its own cache, and the right answer is to stay. A router that only asks "what is the cheapest model for this prompt" gets that case wrong every time.

Nadir cannot know how many turns are left, so it prices over a short, conservative default horizon unless the agent's harness sends its own estimate.

4. Call: your agent makes the call

Nadir's answer is a model and an effort. The agent makes the provider call itself, on its own sign-in or API keys, straight to the provider it already uses. With the Claude Code, Codex and Cursor installs the agent keeps its own sign-in and provider, and Nadir only answers which model.

Receipt
This turn, on the mid model$0.028
Same turn, on the top model$0.070
Provider callyour agent, your keys

The receipt prices the turn's own tokens at list price: 8,000 in, 1,200 out. The cache line is in stage 3. Because Nadir did not make the call, the receipt is a projection. The real number is on your provider's bill. The decision comes back with its reasons attached, the model, the effort, the cache verdict and the projected cost of both paths, so you can audit why each turn went where it went.

What this walkthrough leaves out

Nadir publishes no universal savings or quality percentage until one is measured on outcome-labelled customer traffic. The useful number is the one from your own turns.

If your team's coding-agent bill is the number you are trying to move, book a call and we will walk your own sessions through the same four stages, or see pricing.

More on nadir & alternatives

What Nadir is

Nadir is an LLM router. Nadir sends each prompt to the cheapest model that can handle it. A small decision model reads each prompt against your model menu and picks the lowest-cost model it expects to handle it. When the decision model is uncertain or unavailable, the request goes to the strongest model on the menu. The routing step makes no call to your model provider.

Nadir runs two ways. The decision API returns a model, reasoning-effort, cache, context, and policy recommendation without calling a model provider, beside the gateway you already run. That is how a shadow-mode evaluation works, and its projected savings stay advisory. The OpenAI compatible managed proxy executes the route, and migration is a two-line change: point the base URL at api.getnadir.com and set model to auto. On that path an optional verifier can score a complete non-streaming answer and escalate to a stronger model when it misses the configured bar. Streaming bypasses post-generation verification. BYOK is supported on every tier.

For coding agents, Nadir Auto is a terminal launcher for Claude Code or Codex that asks Nadir for the main-session model before each turn, with your configured model as the fallback and cost ceiling. Delegation integrations for Claude Code, Codex, or Cursor instead recommend a model tier for subagent work, and the agent decides; the Claude plugin can also move a main-thread turn to Haiku when Nadir's cache check prices it cheaper, unless its switch_main_model option is off. Either way inference runs on your own provider account, so Nadir holds no provider keys on that path.

What the numbers are, and what they are not

Nadir publishes each evaluation with its scope. On checkable code, run-check-escalate solved 392 of 395 common HumanEval and MBPP problems (99.2%), graded by running the canonical tests; that applies only to tasks with runnable deterministic tests. Nadir-Tumbler posts an arena_score of 72.3 on RouterArena's public scorer, 5th of 23 routers, which measures the routing decision on RouterArena's own model pool. A reference-assisted RouterBench evaluation over 11,420 held-out triples produced a 60% lower projected cost than always-Opus with about 98% retained quality and a 1.7% catastrophic-route rate. That experiment gave the verifier the expensive-model reference answer, which production does not have, so it is a research ceiling and not the deployed path.

None of these is a production guarantee, a universal savings rate, or a forecast for any particular workload. Customer savings are reported from measured execution against a declared baseline, and customer quality only from outcome-labelled traffic. Projected savings and realized savings are separate artifacts and are never blended.

Design-partner program

Three rungs, picked by risk appetite. Rung 0 Shadow runs advisory decision calls alongside live traffic and returns a projected receipt, with nothing in the request path changed. Rung 1 Hosted is the two-line swap on a production slice and returns a realized receipt. Rung 2 On-prem is a supervised six-week proof of concept inside the partner's VPC, where no prompt, response, or usage reaches Nadir. The commitments are the same at every rung. Apply for a rung directly: Rung 0 Shadow, Rung 1 Hosted, or Rung 2 On-prem. Not sure which fits? Start at getnadir.com/contact/?reason=design-partner.

Licensing

NadirClaw is the self-hosted core, source-available under the PolyForm Noncommercial License. Source-available is the correct label; NadirClaw is not open source. Nadir Route's hosted plan has no base fee and charges a variable fee only on measured savings from requests Nadir executed.

Pages on this site

Machine-readable summaries of this site: llms.txt and llms-full.txt.