OptionalcapacityOptionalclientTimeout in milliseconds bounding how long the gateway will wait for a
backpressured client to drain before giving up on it. Guards against a
client that stops reading entirely (TCP connection stays open, but no
drain and no close ever fires) — without this bound, the handler
parks in waitForDrain forever, pinning its bulkhead slot and token
budget reservation indefinitely. On timeout, the response socket is
destroyed, which cascades through close to unwind the handler and
release its admission hold. Defaults to idleTimeoutMs when omitted;
if both are omitted, a stalled client is never bounded (matching prior
behavior).
OptionalidentityAuthenticated request identity, role authorization, and role priority.
OptionalidleTimeout in milliseconds for the gap between consecutive chunks of a streaming upstream response body. Guards against a stream that starts fine but then stalls mid-flight (e.g. a hung upstream connection that never sends more data and never closes). The timer resets on every chunk received, so a healthy long-running stream that keeps sending data — no matter how long the overall stream lasts — is never killed by this timeout. Only applies to streaming responses. Omit for no idle timeout.
OptionalisOptional process-level readiness gate, such as managed control-plane state.
OptionalmaxCeiling for output-limit fields (max_tokens / max_completion_tokens).
Requests specifying a value above this are rejected with 400 before
admission. This is a sanity bound against malformed/malicious input,
not a business policy — actual per-pool output reservation defaults
are controlled by PoolConfig.outputCap. Defaults to 200,000.
OptionalmaxMaximum number of bytes buffered from a request body before it is
rejected with 413. Guards against unbounded memory growth from
oversized or malicious payloads. Defaults to 1 MiB (1_048_576 bytes).
OptionalopenaiOpenAI-shaped upstream base URL, e.g. "https://api.openai.com".
Powers POST /v1/chat/completions and POST /v1/responses. Omit to
disable both OpenAI routes.
OptionaloperatorOptional bearer token protecting /stats and /metrics.
OptionalresolveOverride per-pool identity rules with a trusted bounded admission-class ID. Return undefined to use the pool's configured default class.
OptionalresolveResolve admission priority from an authenticated/trusted request context. This is the preferred way to grant high-priority capacity.
OptionalresponsesOpt-in response memory for OpenAI Responses follow-ups.
With it, Tyr records the provider-reported size of each Responses reply
and admits a request that names previous_response_id when it holds a
record for that response, reserving the request's own estimate plus the
recorded size. A follow-up without a usable record gets 422 unknown_previous_response and the provider is not called. Without this
option, previous_response_id is rejected as an invalid request.
Records are local to this process. Requires openaiUpstreamUrl.
OptionalresponseTimeout in milliseconds for the upstream to send response headers
(i.e. for the fetch() call to resolve). Covers "upstream never
responds at all" — a stalled connection attempt or a hung server that
never sends a status line. Cancelled the moment headers arrive; it has
no effect on how long a streaming body may subsequently take (see
idleTimeoutMs for that). Combined with the client-disconnect abort
signal — whichever fires first aborts the upstream call. Omit for no
response timeout (client disconnect is still honored).
OptionalretryTuning for the Retry-After hint returned on capacity rejections.
Tyr estimates the wait from observed upstream completion intervals for
the pool. Until it has enough samples it emits no hint rather than a
fabricated one. Omit to accept the defaults; set enabled: false to
suppress the headers entirely.
OptionalshutdownMaximum graceful-drain wait during shutdown. When the deadline expires, Tyr reports outstanding work and closes remaining HTTP connections. Omit for an unbounded drain, which waits for final token settlement even after a borrowed local slot was returned by deadline abandonment.
OptionalshutdownStop every request still running when shutdownDrainTimeoutMs elapses.
A stopped request that has been sent no part of its reply gets 503 admission_stopped with cause drain_deadline, a reply already under way
is cut, and each is counted and audited as stopped. Tyr then closes the
remaining connections as before. Requires shutdownDrainTimeoutMs.
Default: false, which closes connections without stopping anything.
OptionaltelemetryPrometheus and structured admission-audit configuration.
OptionaltrustTrust the raw client-supplied x-priority header. Disabled by default
because an unauthenticated caller could otherwise self-assign the
reserved high-priority tier. Enable only behind a trusted proxy that
strips client copies and injects the header itself.
OptionalupstreamAnthropic-shaped upstream base URL, e.g. "https://api.anthropic.com".
Powers POST /v1/messages. Omit to disable that route.
Optional Tyr-to-Tyr capacity-aware request routing.