https://api.getnadir.com/v1/recommendReturn the production router's model choice for a prompt. This is the same decision the proxy makes on model="auto", handed back to you instead of acted on. No LLM call.
Tip
Authentication
Required. Send your key as X-API-Key. The candidate model set defaults to the models configured on that key.
Request body
promptstringRaw prompt text to route. Supply this or messages.
messagesobject[]OpenAI-style message list, used when prompt is omitted. Content-part arrays are flattened to their text parts.
modelsstring[]Candidate models to choose among for this request. Defaults to the models configured on the API key.
cache_stateobjectSession prompt-cache state. When set, the decision becomes cache-aware: switching models forfeits the warm prefix, and the recommendation accounts for that.
Example
curl https://api.getnadir.com/v1/recommend \
-H "Content-Type: application/json" \
-H "X-API-Key: $NADIR_API_KEY" \
-d '{
"prompt": "Summarize this changelog in two sentences.",
"models": ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-6"]
}'Response
recommended_modelstringrequiredModel the router would dispatch to.
selection_methodstringrequiredDecision path that produced the choice.
tierstringsimple, medium, or complex, when the classifier ran.
complexity_scorenumberRaw analyzer complexity score.
confidencenumberClassifier confidence in the range 0 to 1.
cluster_idintegerPrompt cluster, when cluster routing applied.
reasoningstringHuman-readable routing rationale.
candidatesstring[]Models the router chose among.
cache_adviceobjectCache-aware analysis. Present only when cache_state was supplied.
latency_msintegerrequiredDecision latency in milliseconds.
Info
api.getnadir.com/openapi.json. The values in the example response are illustrative, not a recorded call.Cache-aware routing
Switching models mid-session throws away the prompt cache you already paid to warm. If you pass cache_state, the recommendation prices that forfeit and returns a cache_advice object with decision, stay_cost_usd, switch_cost_usd, and switch_penalty_usd. The override only ever moves toward equal or better quality.
Info
/v1/bucket when you want the tier and will map it to models yourself, or when you want a call that works with no key. Use /v1/recommend when you want one model name from the full production router.