config/gateway.toml relative to the working directory. All sections except [server] are optional.
For an explanation of routing concepts, see Routing. For provider-specific details, see Providers.
Full config reference
Section reference
[server]
Network binding for the gateway process.
[defaults.provider]
Global defaults applied to every provider unless the provider overrides them explicitly.
[providers.*]
Each named table registers a provider and the models it serves. The table key is the provider identifier (e.g., openai, anthropic, groq).
When
credential is omitted, the gateway uses a per-provider convention based on the table key. For example, the openai provider defaults to env::OPENAI_API_KEY, and the anthropic provider defaults to env::ANTHROPIC_API_KEY. Set credential = "none" to disable credential resolution entirely for a provider.[models.*]
Per-model overrides. The table key is the model name as it appears in a provider’s models array.
The timeout resolution order is:
[models.*].timeout_ms > [providers.*].timeout_ms > [defaults.provider].timeout_ms > hardcoded default (30 000 ms).
[targets.*]
Each named table declares a managed routing target — a specific model paired with gateway-owned credentials. The table key is the target identifier referenced by routes and functions.
When
credential is set to an "env::VAR_NAME" location, the environment variable must be present at startup. The gateway fails fast on missing managed credentials rather than discovering the problem at request time.[routes.*]
Each named table defines a managed route that maps one or more model names to a set of targets with a selection strategy. The table key is the route identifier.
When
steps is present, each step defines its own strategy and targets. Steps execute as an ordered fallback chain. The top-level targets field is ignored when steps is provided.[routes.*.retry]
Per-route retry configuration. When present, overrides the global [routing.retry] settings for this route.
[routing.surfaces]
Per-surface availability for the routing ingress surfaces. Every surface defaults to enabled; set one to false to reject requests to that surface with 403 feature_disabled — without running a feature-flag backend. Omitting the section (or any field) leaves the surface enabled.
[functions.*]
Each named table defines a function — a named routing alias that maps a task name to a strategy and set of models or targets. The table key is the function name (e.g., summarize, extract-entities).
Callers invoke a function by sending model: "function::summarize" or, when no provider or route shares the name, model: "summarize" (resolved via top-down lookup).
models and targets are mutually exclusive on a function. When models is used, the gateway creates ephemeral targets internally by resolving each model name through the provider configuration. Each inline model must exist in exactly one provider’s models array.[functions.*.variants.*]
When strategy = "experiment", variants define the A/B test arms. Each named table under variants is a variant configuration.
Params are validated against an allowlist per endpoint type. Unknown params pass through with a startup warning. Protected fields (
model, messages, input, file, prompt, stream) cannot be set as params.
EndpointType enum
The endpoint field on functions and routes accepts one of:
[functions.*.retry]
Per-function retry configuration. When present, overrides the global [routing.retry] settings for this function.
[routing]
Global routing behavior settings. This section is optional — when omitted, all sub-sections use their defaults.
[routing.retry]
Global retry settings applied to all managed routes and functions that do not declare their own [routes.*.retry] or [functions.*.retry] block.
The retry layer wraps every managed-route attempt with exponential backoff (powered by the
backon crate).
[routing.circuit_breaker] (deprecated)
[security]
Inline security pipeline for input guardrails.
When enabled, the security pipeline runs PII detection (always on) and blocklist matching on every request before it reaches the upstream provider. See Security Overview for details.
[telemetry]
Application-level telemetry (HTTP spans, latency) exported over OTLP to an observability backend.
[genai_telemetry]
Dedicated GenAI telemetry sink for the spans and metrics that power the to11 dashboard (Projects → Traces).
[auth]
Optional per-request platform authentication for customer-hosted gateways. When enabled, the gateway exchanges a platform credential for a short-lived collector JWT and exports GenAI telemetry with that request-scoped token.
[tenant_routing]
Per-tenant routing configuration for platform mode (managed SaaS). When enabled, each project gets its own routing config loaded from Redis with API fallback. This section is only relevant in multi-tenant platform mode.
The
api_fallback_auth_token is a service-scoped API key carrying routing:publish. The gateway exchanges that caller credential at POST /v1/routing/mint-read-token for a short-lived fallback JWT before reading GET /internal/routing/snapshots/:projectId/:envSlug. The fallback response can contain plaintext provider credentials for the gateway, so ordinary routing:read principals cannot mint fallback tokens.[cache]
Response caching backed by Valkey (Redis-compatible). When enabled, identical LLM requests can return instantly from cache.
Config file location
Override the default path with theGATEWAY_CONFIG environment variable:
Environment variable overrides
Environment variables take precedence over TOML values.Application telemetry
Tenant routing
GenAI telemetry
Logging
Control log verbosity with theRUST_LOG environment variable: