Skip to main content
Direct routing (the single strategy) sends all traffic for a route to one target. Once it is in place, callers send requests to the route by name and to11 uses the stored credential to reach the provider — the caller does not supply a provider key. Use it when one provider and one credential are all you need for a model.

Before you start

  • A provider connected under Project → AI Gateway → Providers whose access policy allows the model you want. See Connecting a provider.
  • A stored credential for that provider, set up under Credentials.

Create a Direct routing rule

  1. Open Project → AI Gateway → Routing.
  2. In the routing list, start a new rule with the create-rule flow.
  3. Choose the Direct routing strategy.
  4. Give the rule a Name, for example gpt-4o-direct. Your application calls it as route::gpt-4o-direct.
  5. Choose the target: the Provider, the Model (pick a suggestion or type an id, for example gpt-4o), and the stored credential to use for it.
  6. Save the rule.
From now on, requests to route::gpt-4o-direct resolve to this route, and to11 injects the stored credential. Requests that name a provider directly, as <provider-slug>::<model>, keep using passthrough.

Send a request

Once the rule is live, call the route by name. The caller needs only its to11 credential — no provider key:
to11 resolves the route, uses the stored credential, and proxies the request to the provider. You receive a standard chat completion response.
The to11 credential goes in x-to11-authorization. Authorization (or x-api-key) is reserved for an upstream provider key when you bring your own — it is not used for a managed route.

Managed and passthrough together

A project can mix the two, and each request picks one through its model field. For example, with Direct routing rules named gpt-4o-direct and claude-direct: To confirm how a given request resolved — managed route or passthrough, and which target served it — open Projects → Traces in Observe.

Next steps

Weighted split

Split traffic across multiple targets by weight.

Fallback chain

Fail over to the next target on error.

Routing overview

The three-layer model and how a request picks its layer.