OmniRoute nadir Strategy

Use the nadir router strategy built into OmniRoute 3.8.52+, set up from the combo builder since 3.8.54, or the custom provider path on earlier versions.

Prompt-aware model choice for OmniRoute, built in as the nadir router strategy. There is no plugin to install and no application code to change.

Info

The nadir strategy shipped in OmniRoute 3.8.52, released October 19, 2026. OmniRoute 3.8.54, released November 17, 2026, adds a Nadir section to the combo builder, so the key, timeout and base URL can be set without editing JSON (npm install -g omniroute@3.8.54). On a version before 3.8.52, use the custom provider path at the end of this page.

What it adds

OmniRoute already decides which connection serves a model, ranking accounts by quota, health, cost and latency. Its existing complexity heuristic supplies a keyword-based signal. The nadir strategy adds Nadir's prompt classification and leaves connection selection to OmniRoute.

  • OmniRoute sends the last user message and the model ids in the combo to POST /v1/bucket.
  • Nadir classifies the prompt as simple, medium or complex and returns one of your model ids, verbatim, as selected_model.
  • OmniRoute's rules strategy then picks the connection that serves that model, so quota, health and cost still decide which account.

Provider keys stay in OmniRoute and the completion never passes through Nadir. Only the decision does.

Set it up

1. Give OmniRoute a Nadir key

Create a key under API Keys in the Nadir dashboard, add it to OmniRoute's environment, and restart OmniRoute.

.env
OMNIROUTE_NADIR_API_KEY=ndr_...

A keyless call lands on Nadir's anonymous tier, which is burst-limited per IP. Behind a shared gateway that limit runs out quickly, and every request over it quietly falls back to rules. Set a key.

Info

Calls with a key are billed: the first 50 requests a month are free, then $0.002 each from a prepaid balance. When the balance is empty, Nadir answers HTTP 402 balance_empty and every request falls back to rules the same way, so top up or turn on auto-recharge in Billing before you rely on it.

On 3.8.54 or later you can set the key per combo in the dashboard instead. Choose the Nadir router strategy in the combo builder, and a Nadir decision API section appears with three optional fields: API key, Timeout (ms) and Base URL (self-hosted). Empty fields fall back to the environment variables. A key entered there is saved with the combo; see the note under Configuration.

2. Create an auto combo that uses it

The combo's model list is the menu Nadir chooses from. Creating a combo through OmniRoute's API, when authentication is enabled, takes a management credential: a key created with the manage scope, or a dashboard session. An inference-only key is rejected with HTTP 403; the error text can vary with the authentication path. Use the dashboard's API Keys settings to enable the manage scope.

Shell
curl -X POST http://localhost:20128/api/combos \
  -H "Authorization: Bearer <your-omniroute-manage-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "nadir-auto",
    "strategy": "auto",
    "models": [
      "anthropic/claude-haiku-4-5",
      "anthropic/claude-sonnet-5",
      "anthropic/claude-opus-5"
    ],
    "config": {
      "routerStrategy": "nadir"
    }
  }'

In the dashboard's combo editor, the same choice is the router strategy named Nadir (route by prompt complexity). Write each model id the way your OmniRoute providers list it. Nadir accepts OmniRoute's spellings, including dotted versions such as claude-sonnet-4.6.

3. Call the combo

Send the combo's name as the model. Nothing else about the request changes.

Shell
curl http://localhost:20128/v1/chat/completions \
  -H "Authorization: Bearer <your-omniroute-key>" \
  -H "Content-Type: application/json" \
  -d '{"model":"nadir-auto","messages":[{"role":"user","content":"What is the capital of France?"}]}'

Choosing the models

For each tier, Nadir picks the cheapest model in the menu that clears that tier's capability floor. The pool therefore decides what routing can do.

  • Span the tiers. A small, a mid-size and a frontier model give every prompt somewhere to land. Three frontier models give Nadir nothing to choose between. Each model also needs a score in Nadir's capability snapshot, which since November 2026 is on the Artificial Analysis Intelligence Index v5.0. That index has no score for claude-sonnet-4.6 or claude-sonnet-5, so Nadir skips them: in a Haiku 4.5, Sonnet 5, Opus 5 pool medium prompts go to Opus. A pool of claude-haiku-5-5 and claude-opus-5-5 sends simple and medium prompts to Haiku and complex ones to Opus.
  • List only what you will serve. A menu says every model in it is acceptable, across vendors. With claude-haiku-5-5, gpt-6.1-terra and claude-opus-5-5 in one pool, a complex prompt goes to gpt-6.1-terra. Keep the combo to one vendor if that matters to you.
  • Keep it under 100. The menu holds at most 100 distinct model ids, and OmniRoute sends the first 100. Ids Nadir does not recognize are skipped. If none resolve, the request falls back to rules.

A model is left out of the menu when every connection serving it has an open circuit breaker, unless every candidate in the pool does.

Configuration

Per-combo settings go in a config.nadir block, which the 3.8.54 combo builder writes for you. The two strings fall back to environment variables when the block leaves them unset.

Combo config
"config": {
  "routerStrategy": "nadir",
  "nadir": {
    "apiKey": "ndr_...",
    "baseUrl": "https://api.getnadir.com",
    "timeoutMs": 2000
  }
}
FieldEnv fallbackDefaultMeaning
routerStrategynonerulesSet to nadir to opt the combo in
nadir.apiKeyOMNIROUTE_NADIR_API_KEYunsetNadir key, sent as X-API-Key. Wins over the env var
nadir.baseUrlOMNIROUTE_NADIR_BASE_URLhttps://api.getnadir.comNadir API origin. A trailing /v1 is stripped
nadir.timeoutMsnone2000Decision call budget in ms; positive values capped at 30000

Warning

A key in config.nadir.apiKey is saved with the combo in OmniRoute's database. Prefer the environment variable unless different combos need to bill to different Nadir accounts.

Info

Point baseUrl at a self-hosted Nadir deployment to keep the decision call, and the prompt text it carries, inside your network. See Self-Host.

What reaches Nadir

Each request sends three things: the text of the last user message, cut at 16,000 characters, the model ids in the pool, and source: "omniroute". No system prompt, no earlier turns, no tools, no headers and no provider keys.

A keyed decision is logged to your Nadir account. By default the log row includes the prompt text, so the dashboard can show it back to you. Turn prompt storage off under Settings, or per key, and Nadir stores a sha256: digest in its place. Routing is unaffected either way.

Guarantees

  • Opt-in. Only combos with routerStrategy: "nadir" call Nadir. Every other combo behaves exactly as before.
  • Fail-open. A timeout, a non-2xx response, an unreachable host, a malformed body, a request with no user text, or a selection outside the pool all resolve to the rules decision. Inference still depends on an available, working upstream provider.
  • Bounded. One POST per request, under timeoutMs. A transport error, non-2xx response, invalid JSON or malformed response object starts a 30-second cooldown per base URL in that strategy instance. A valid response with a missing or out-of-pool selection falls back for that request without starting the cooldown. Concurrent requests already in flight can each incur a timeout.

Seeing the decision

OmniRoute's combo log line reads strategy=nadir for every request on the combo, including fallbacks. The reason text tells them apart: when Nadir made the choice it carries the tier and confidence.

NadirStrategy: bucket=complex confidence=0.93 model=claude-opus-5 (...)

A fallback keeps the rules reason, prefixed with why Nadir was skipped. HTTP 401 indicates an authentication rejection. HTTP 402 means the key's prepaid balance is empty. A missing Nadir key uses the rate-limited anonymous tier.

NadirStrategy: fallback (call failed: HTTP 401); ...

Before 3.8.52: the custom provider path

Any OmniRoute version can reach Nadir as an OpenAI-compatible provider. This is a different trade. Nadir runs the completion, so prompts and responses pass through it, and provider usage is billed through Nadir or your own keys under BYOK. The full comparison is on OpenAI-Compatible Gateways.

Add Provider, OpenAI-compatible
Base URL:  https://api.getnadir.com/v1
API key:   your Nadir key
Prefix:    nadir

Then send model: "nadir/auto". auto is a routing instruction rather than a model, so /v1/models does not list it. Add it to the provider's models by hand if OmniRoute does not offer it. If requests 404, check the URL with the curl test on that page before anything else.

What has been validated

The strategy is merged upstream with its own test suite. The suite injects a fake decision call and covers the request shape, menu deduplication, circuit-breaker filtering, every fallback path, the failure cooldown, base URL and timeout handling, and the prompt cap. The decision side is a live check against api.getnadir.com: a menu in OmniRoute's spelling, dotted ids included, resolves, and selected_model comes back verbatim.

The October 20, 2026 validation run exercised the packaged npm release, 3.8.52, end to end for routing: an auto combo over Haiku 4.5, Sonnet 4.6 and Opus 5 behind a local mock provider, keyless against api.getnadir.com. A short lookup went to Haiku 4.5 and a concurrency design prompt to Opus 5, each with the tier Nadir returned. The mock supplied the completion responses; this did not validate real model inference. The request that reached Nadir held only the last user message, the bare model ids and source: "omniroute". With the base URL pointed at a dead port, requests still completed through rules and the next one skipped the call during the cooldown.

Not yet tested: the Nadir API-key-authenticated decision path through OmniRoute, the custom provider path, real upstream model completions, and the revised Sonnet 5 combo example.

Pages on this site

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