Skip to navigation

Deterministic strategies

Priority routing with ordered failover across models and vendors

The Priority strategy tries models in your order and moves to the next when one fails. Use it for predictable routing: a primary model, then backups. To have Gateway match each prompt to a model, use Intelligent routing.

How it works

For each model in the list, Gateway tries its eligible vendors, cheapest first, before moving to the next model. A request error stops the chain; throttles, outages, and billing failures move it forward (status codes).

A one-model list is valid. It still fails over across that model’s vendors unless you pin one, so outages reach callers only when the model has a single vendor or every vendor fails. Add a second model for production traffic.

Configure a Priority policy

WhereHow
DashboardRouting policies → Policies, strategy Priority. Drag models into order
/v1/routing-policies API"strategy": "PRIORITY" with priority_order: [{"model": "...", "priority": 1}]. Lower priority runs first. See the API reference
Per requestSend priority_order on the request instead of storing a policy. See Sending a priority list with the request

Callers select a policy by its model alias: "model": "@alias/<slug>".

Next steps