How It Works
The order a single request passes through the gateway, what the control plane decides, and what comes back on the response.
How It Works
The request path
Each request is served against one immutable snapshot of the gateway's runtime configuration, and follows this order:
- Read and bound the body. Normalize the surface and resolve identity, model, installation, issued key and billing regime. Keyed requests routed through a connector pass the router stage here, resolving the routing profile and producing a routing decision record.
- Apply the governance gate -- on the decided model, before any cache is consulted.
- Check the caches. The exact-match cache, and the semantic cache where it is permitted. Coding-client traffic can bypass caches.
- Apply the spend gates. On a provider-bound request, the rate, token and spend ceilings, and resolve the forwarding credential.
- Apply transformations. Deterministic lossless transforms always; content-dropping transforms only where they have been promoted and their rollout stage permits. Retrievable originals may be preserved for eligible transforms.
- Forward to the provider and parse either the complete response or the streaming metadata.
- Account and record. Accrue actual usage and cost, write eligible cache entries, and enqueue telemetry without blocking the response.
Step 2 gating the decided model rather than the string the client sent is what makes an allowlist meaningful: it governs what will actually be served, and it is also what makes a request that named no model governable at all.
What the control plane decides
The gateway asks the control plane four kinds of question, and caches each answer behind a freshness window:
| Question | What it returns |
|---|---|
| May this request spend? | An authorization decision: allow, deny, or deny with a reason. Budgets, rate and token ceilings, model and provider access. |
| Which routing profile applies? | The merged profile for this team, identity and issued key. The fresh window on this answer is the bound on how long a profile edit takes to reach traffic. |
| Which credential do I forward with? | A short-lived forwarding credential, resolved through the custody ladder. |
| Which trials are armed? | The active trial specifications for this team. Withholding a trial here is how the platform stands a gateway's evaluation engine down. |
Every one of these degrades rather than fails. A control-plane blip is served from the cached answer; a stale answer still routes; an answer that cannot be established at all is refused explicitly rather than defaulted, wherever defaulting would silently change where your traffic goes or who pays for it.
What comes back on the response
Keyed inference responses carry two join keys:
| Header | Value |
|---|---|
X-Dz-Request-Id | The id the trace and telemetry rows for this request are stored under. Use it to find the request in the dashboard. |
X-Cache | MISS, HIT or SEMANTIC-HIT. |
X-Cache is stamped MISS before the cache is consulted and overwritten by
whichever hit path serves, so the value is exhaustive -- you never have to read
an absent header as a miss.
Both headers are emitted on keyed inference only. Passthrough traffic is forwarded byte-identically in the response direction and -- with two Anthropic-native compatibility exceptions -- in the request direction too, so the gateway adds no header there.
Caching
Caches are keyed on the decided model. A request served by auto mode has no decided model until the pick is made, so delegated turns bypass the exact and semantic caches -- auto costs one uncached turn per session, not an uncached conversation, provided the client supplies a session id and the pin can be read. Without either, every turn delegates and the whole conversation is uncached.
Failure behaviour
Keyed traffic egresses through one connector upstream, so its outage has no alternative path. The gateway therefore carries an explicit failure posture:
- A bounded retry budget and a circuit breaker, installed as the proxy's transport so retries are structurally confined to the window before any body is streamed.
- Retries fire only for connect failures, the upstream's own request timeout, and the upstream's own 5xx. Throttles, provider errors and caller-side rejections are never retried.
- There is no queueing and no emergency direct-provider egress.
Every failure is classified into a provider-neutral taxonomy that records
where the failure happened -- upstream unreachable, the upstream's own error,
a provider behind it, a mid-stream break, an upstream cap, or the gateway's own
gate. Callers receive a stable provider-neutral error envelope with the
upstream's detail attached under dz_upstream, never the upstream's own
message.
A mid-stream failure cannot change a status that has already been committed, so it is reported in-band as a terminal SSE error frame rather than as a silent truncation.
Health and readiness
The gateway publishes two separate probe endpoints, and the difference matters if you are operating it yourself:
| Endpoint | Meaning |
|---|---|
/health | Liveness. Answers 200 ok regardless of upstream state -- failing it during a provider outage would restart proxies that are working. Keyed upstream health (breaker state, windowed error rate by class, backstop trips) is published additively here. |
/ready | Readiness, and the only route that reports the drain. Answers 503 from the instant the process observes SIGTERM, so the pod leaves the service endpoints while its in-flight requests are still being served. |
Both are also served on a probe-only listener that is shut down last, after the drain and the telemetry flush.
What is Nautir
Nautir is DevZero's LLM inference platform -- a gateway in your request path plus a control plane that governs, measures and evaluates what flows through it.
Key Concepts
The vocabulary the product uses -- sources, surfaces, credentials, regimes, savings, guardrails, profiles and evidence.