https://api.getnadir.com/v1/routeChoose a model, effort, and prompt together. The default v2 decision compares original and compacted prompts on eligible models from your menu, including cache reads and writes. It keeps your current model when no supported alternative clears the quality and estimated cost checks.
Info
Request
Works keyless within the anonymous limits. Send X-API-Key for account policy and attribution. The current model must belong to the allowed menu; an organization policy conflict returns 409 and blocks dispatch.
promptstringrequiredThe complete task, up to 500,000 characters. Model changes require full classifier coverage.
current_use_modelstringrequiredYour baseline. The alias requested_model is also accepted.
allowed_modelsstring[]requiredExact runnable model IDs, including the baseline. The alias menu is also accepted.
axesstring[]Required coding, agentic, or math evidence. Missing or stale evidence cannot certify a candidate.
cacheobjectSupply model, total current_input_tokens, and measured cached_tokens. Zero means known cold. Omit cached_tokens when reuse is unknown: the baseline is priced fully cached and alternatives fully written. Without input/cache evidence, the original is retained. The default horizon is one turn; expected_output_tokens includes reasoning.
executionobjectDeclare model_switch, prompt_rewrite, and effort support. Unsupported actions are excluded.
minimum_tierstringOptional simple, medium, or complex floor. It can raise the classifier tier, never lower it.
costsobjectDeclare decision_usd and retry_reserve_usd so fees and recovery allowance are included.
preserve_prefix_charsintegerKeep this leading prefix byte-identical. V2 supports safe compaction only.
Example
curl https://api.getnadir.com/v1/route \
-H "Content-Type: application/json" \
-d '{
"prompt": "Fix the spelling of recieve in README.md.",
"current_use_model": "claude-opus-5-5",
"allowed_models": ["claude-opus-5-5", "claude-haiku-4-5"],
"axes": ["coding", "agentic"],
"cache": {"model": "claude-opus-5-5", "cached_tokens": 0},
"execution": {"model_switch": true, "prompt_rewrite": true, "effort": false}
}'Apply the response
Run suggested_model, suggested_effort, and suggested_prompt, also available as model, effort, and prompt. Null effort preserves the baseline setting on a keep and omits an override on a switch. Preserve unrelated dispatch parameters and verify the harness applied the choice.
The decision object contains action, required_tier, reason, baseline_cost_usd, selected_cost_usd, savings_usd, ceiling_met, candidate evidence, and assumptions. Changed recommendations must clear the default 5% savings floor. Declared decision fees can make a no-op exceed the baseline; that is reported, not hidden.
Use decision_version: route-v1 explicitly for the older contract. Unknown request fields return 422. Never substitute bucket.plan.model for the authoritative returned model.