Documentation Index
Fetch the complete documentation index at: https://to11.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Targets
A target is a named entry in[targets.*] that pairs a specific model with a credential the gateway owns. Targets are the building blocks of managed routing — they let the gateway inject its own API key instead of relying on the caller to provide one.
Why targets exist
In passthrough mode, every caller supplies their own API key via theAuthorization header. That works well on developer workstations but becomes limiting in shared environments — staging clusters, CI pipelines, or production deployments where a central platform team manages provider relationships and budgets.
Targets solve this by shifting credential ownership to the gateway. Callers send requests without an API key for models that have targets, and the gateway injects the appropriate key from the environment. Models without targets continue to work as passthrough.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The upstream model name. Must appear in a provider’s models list. |
credential | string | No | Credential location (env::VAR_NAME). Overrides the provider-level credential. |
weight | integer | No | Relative weight for the weighted routing strategy. Defaults to 1. |
timeout_ms | integer | No | Per-target timeout override in milliseconds. |
Configuration example
Two targets for the same model using different API keys — useful for distributing load across accounts or separating billing:Credential resolution chain
When the gateway resolves credentials for a target, it checks three levels. Each level has different failure behaviour:-
Strict resolution — When a target declares
credential = "env::VAR_NAME", the environment variable must exist at gateway startup. If it is missing, the gateway fails fast with a configuration error. This prevents silent misconfiguration in production. - Lenient resolution — When the target does not declare its own credential, the gateway falls back to the provider’s credential (explicit or convention-based). Lenient resolution returns an empty string if the environment variable is missing, which means the caller’s own key will be used instead.
Bare targets shorthand
When you declare targets without any corresponding[routes.*] entries, the gateway automatically creates a route for each target’s model. If exactly one target exists for a model, it uses a single strategy. If multiple targets share the same model, it creates a fallback strategy so each target is tried in order.
How targets relate to routes and providers
Targets sit between providers and routes in the gateway’s configuration hierarchy:- Providers define where to reach an API and which models it serves.
- Targets bind a model to a specific credential (and optionally a weight or timeout).
- Routes reference targets by name, grouping them into a selection strategy.
Next steps
Routes
How routes map model names to strategies across targets.
Providers
Provider configuration and credential defaults.
Configuration Reference
Full TOML configuration reference.