Deterministic strategies

Single provider, ordered failover, and latency- or cost-ranked routing

Deterministic strategies route by fixed rules rather than per-request ML scoring: one provider, an ordered failover list, or a ranking by observed latency or price. Use them when you want predictable routing you can reason about; use Intelligent routing when you want Gateway to match each prompt to a model tier.

The JSON on this page shows policy definitions, the configuration you set when creating a routing policy in the dashboard. They are not fields on the POST /responses request body.

Single provider

One provider, no failover, fully deterministic. Best for dev and test environments, or single-vendor setups where you want Gateway’s governance without routing behavior.

1{
2 "name": "Simple OpenAI",
3 "default_strategy": {
4 "type": "fallback",
5 "providers": [
6 { "provider": "openai", "model": "gpt-5.5" }
7 ]
8 }
9}

For production workloads, add at least one fallback provider (below); a single-entry list means provider outages surface directly to your callers.

Priority

Providers are tried in the order you define. If the first fails (timeout, rate limit, 5xx), the request automatically goes to the next in line, continuing until one succeeds or the list is exhausted. Best for high availability and automatic recovery from provider outages.

1{
2 "name": "HA Priority",
3 "default_strategy": {
4 "type": "fallback",
5 "providers": [
6 { "provider": "openai", "model": "gpt-5.5", "priority": 1 },
7 { "provider": "google", "model": "gemini-3.6-flash", "priority": 2 },
8 { "provider": "anthropic", "model": "claude-sonnet-5", "priority": 3 }
9 ]
10 }
11}

Requests go to the highest-priority provider (lowest priority number). Gateway tracks provider health automatically: a provider accumulating failures is temporarily skipped so requests aren’t wasted on a vendor that’s down. Client errors (400 to 404) don’t trigger failover; provider throttles and outages do. See How it works.

In policy definitions and the Management API, this strategy is "type": "fallback" (API: strategy: "PRIORITY"). The dashboard calls it Priority.

Least latency and lowest cost

Two ranked variants configured through the dashboard only:

  • Least Latency routes to the provider with the lowest observed latency, from rolling per-provider statistics. Best for latency-sensitive applications.
  • Lowest Cost routes to the cheapest provider for the requested capability, from model pricing metadata. Best for budget-focused workloads where several providers serve equivalent models.

The API supports only PRIORITY and INTELLIGENT strategies; these two can’t be created over the API.

Next steps