Nadir Behind OpenAI-Compatible Gateways

Put Nadir behind any gateway with an OpenAI-compatible provider slot, such as Bifrost or LiteLLM, in three settings, and see how it differs from a plugin.

Nadir speaks the OpenAI Chat Completions API. Any gateway with a custom or OpenAI-compatible provider slot can route to it today, with no plugin to install and nothing to merge upstream. Three settings, and the gateway treats Nadir as one more provider.

Which path you want

There are two ways to put Nadir behind a gateway, and they trade differently. Neither is a fallback for the other.

 PluginCustom provider
Where it existsKong, APISIX, OmniRoute, EnvoyBifrost, LiteLLM, new-api, most others
What Nadir receivesThe prompt, for a decision onlyThe prompt, and it runs the completion
Whose provider keysYours, on the gatewayNadir's, or yours under BYOK
Who pays the providerYou, directlyNadir, rebilled to you
InstallA plugin and a restartA config block
If Nadir is downRequests proceed on the default modelThat provider entry fails, and the gateway fails over

The plugin path keeps inference exactly where it is and borrows only the routing decision, so it is the lighter change to a gateway you already trust. It is documented under Kong, APISIX, OmniRoute and Bifrost. The rest of this page is the custom provider path.

The three settings

Every gateway spells these differently, but it is always the same three values.

Whatever your gateway calls them
Base URL:  https://api.getnadir.com     (see the next section)
API key:   your Nadir key, sent as a Bearer token
Model:     auto

auto is what asks Nadir to route. Send a real model name instead and it is honored and passed through, so you can point five percent of traffic at auto and leave the rest pinned while you compare. nadir-auto, nadir, default and an empty model all mean the same thing as auto, because gateways disagree about what they will let you type in a model field.

Nadir accepts the key as either Authorization: Bearer <key> or X-API-Key: <key>. Gateways send the Bearer form, which is why no gateway needs a custom header rule.

Getting the base URL right

This is the one setting that reliably goes wrong, because gateways disagree about who owns the /v1 segment. Some want the bare origin and append /v1/chat/completions themselves. Others want the origin plus /v1 and append only /chat/completions. Copying the wrong one produces /v1/v1/chat/completions, which 404s.

You do not have to guess, and you do not have to spend a completion to find out. An unauthenticated POST tells you, because auth is checked after routing.

Shell
# Right URL. Nadir reached the handler and asked for a key.
$ curl -sX POST https://api.getnadir.com/v1/chat/completions
{"detail":"Missing API key"}

# Wrong URL. Nothing is mounted there.
$ curl -sX POST https://api.getnadir.com/v1/v1/chat/completions
{"detail":"Not Found"}

Tip

Missing API key means the base URL is correct. Not Found means you doubled the /v1. Paste your gateway's fully expanded request URL into that curl before debugging anything else.

Bifrost

Info

To keep inference in Bifrost and take only the routing decision from Nadir, use its Complexity Router instead. See Bifrost.

Bifrost appends /v1/chat/completions to the base URL, so give it the bare origin. Configure it as a custom provider with openai as the base type.

config.json
{
  "providers": {
    "nadir": {
      "keys": [
        {
          "name": "nadir-key",
          "value": "env.NADIR_API_KEY",
          "models": ["auto"],
          "weight": 1.0
        }
      ],
      "network_config": {
        "base_url": "https://api.getnadir.com",
        "default_request_timeout_in_seconds": 300
      },
      "custom_provider_config": {
        "base_provider_type": "openai"
      }
    }
  }
}

The same thing through the API, if you configure Bifrost at runtime.

Shell
curl -sX POST http://localhost:8080/api/providers \
  -H 'content-type: application/json' \
  -d '{
    "provider": "nadir",
    "keys": [{"name":"nadir-key","value":"env.NADIR_API_KEY","models":["auto"],"weight":1.0}],
    "network_config": {"base_url":"https://api.getnadir.com"},
    "custom_provider_config": {"base_provider_type":"openai"}
  }'

Then call it the way you call any Bifrost provider.

Shell
curl -sX POST http://localhost:8080/v1/chat/completions \
  -H 'content-type: application/json' \
  -d '{"model":"nadir/auto","messages":[{"role":"user","content":"hi"}]}'

Raise the timeout rather than leaving it at the default. Nadir sits in front of several upstreams, so a slow provider is a slow Nadir response, and a 30 second ceiling will cut long generations that would otherwise have finished.

LiteLLM

LiteLLM appends only /chat/completions, so its api_base includes /v1. The openai/ prefix selects the OpenAI transport, and auto after it is the model name Nadir receives.

config.yaml
model_list:
  - model_name: nadir-auto
    litellm_params:
      model: openai/auto
      api_base: https://api.getnadir.com/v1
      api_key: os.environ/NADIR_API_KEY
      timeout: 300

new-api and one-api

Add a channel of type Custom, which is the generic OpenAI-compatible channel. Set the proxy address to the Nadir base URL, the key to your Nadir key, and the model list to auto. Nothing else is needed, because the custom channel reuses the built-in OpenAI adaptor.

Channel
Type:     Custom
Base URL: https://api.getnadir.com     (verify with the curl above)
Key:      your Nadir API key
Models:   auto

Info

These two forks disagree with each other and across versions about whether the proxy address carries /v1. Run the 401 test against the URL your channel actually builds rather than trusting either value here.

Anything else

Portkey, Helicone, OpenWebUI, Langfuse proxies, an internal gateway someone wrote, and every self-hosted router with a provider table all take the same three values. If a gateway can call OpenAI at a configurable base URL, it can call Nadir. Nadir also serves the Anthropic Messages API at /v1/messages for gateways that speak that shape instead.

What passes through

The request schema is declared, and anything not on it is dropped silently rather than rejected. That is deliberate, because a 422 on a live proxy endpoint is worse than an ignored parameter, but it does mean an unsupported field fails quietly.

HonoredNotes
messages, modelmodel auto is the routing opt-in
temperature, max_tokens, top_pfrequency_penalty and presence_penalty too
stream, stream_optionsinclude_usage emits the usage-only terminal chunk, as OpenAI does
tools, tool_choice, parallel_tool_callsfunction calling works, and the model selector is tool aware
response_formatjson_object and json_schema
reasoningmapped per provider, clamped per model
userstored on the usage row, so per-user spend is attributable

Fields outside that list, including seed, n, stop and logprobs, are dropped. If your gateway sets one by default, the request still succeeds and that parameter has no effect.

Seeing the decision

On this path the decision comes back in the response body rather than in x-nadir-* headers, which are a gateway plugin convention. The standard OpenAI model field carries the model Nadir actually chose, so every gateway shows it, logs it, and prices against it without understanding anything Nadir specific.

Response
{
  "model": "claude-haiku-4-5",
  "choices": [ ... ],
  "usage": { "prompt_tokens": 18, "completion_tokens": 42, "total_tokens": 60 },
  "nadir_metadata": {
    "recommended_model": "claude-haiku-4-5",
    "routing_strategy": "smart-routing",
    "complexity_analysis": { ... },
    "benchmark_comparison": { ... },
    "cost": { ... }
  }
}

nadir_metadata carries the reasoning, the benchmark comparison and the cost breakdown. A gateway that parses responses into its own struct will drop it, which costs you the detail but never the routing. The dashboard has the same data for every request either way.

Model lists

GET /v1/models requires a key and returns the underlying provider models your key may use. It does not list auto, because auto is a routing instruction rather than a model.

Warning

A gateway that populates its model dropdown from /v1/models will not offer auto. Add it by hand, or pin the provider's model list to auto as the examples above do. Picking a concrete model out of that list is valid, it just pins the request and skips routing.

Privacy

This path differs from the plugin path in one way worth stating plainly. Nadir runs the completion, so prompts and responses reach Nadir, and by default they are stored on the usage row so the dashboard can show them back to you.

Turn that off per account under Settings, or per key. With prompt storage disabled the backend writes a sha256: digest in place of the prompt, drops the response, and marks the row. Routing is unaffected. If prompts must not leave your network at all, use the plugin path or a self-hosted deployment, where the decision is all that moves.

Info

Point api_url at a self-hosted NadirClaw or Nadir instance instead of api.getnadir.com to keep the decision entirely in-network. Both speak the same endpoint contract, so it is a drop-in swap. See Self-Host.

What has been validated

The base URL behavior above is a live check against api.getnadir.com, and the parameter table is read off the shipped request schema rather than remembered. The new-api channel was exercised end to end against a local new-api instance, deliberately with a bad key, which relayed Nadir's own 401 verbatim and so proved URL construction, Bearer auth and error passthrough without spending anything.

The Bifrost and LiteLLM config blocks follow each project's documented custom provider contract and have not been run by us on every release of either. Both projects also have a first-class Nadir provider proposed upstream. If one of those lands, the custom provider block becomes a built-in provider entry and the three settings do not change.

Pages on this site

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