> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Deterministic strategies

> How the Priority strategy orders models, fails over, and handles a single-model list, in the dashboard, the API, and per request.

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](/merge-gateway/routing/intelligent).

## 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](/merge-gateway/routing/using-policies#failover)).

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

| Where                      | How                                                                                                                                                                                                           |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Dashboard                  | [**Routing policies → Policies**](https://gateway.merge.dev/routing-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](/merge-gateway/management-api/routing-policies/create-routing-policy) |
| Per request                | Send `priority_order` on the request instead of storing a policy. See [Sending a priority list with the request](/merge-gateway/routing/using-policies#sending-a-priority-list-with-the-request)              |

Callers select a policy by its [model alias](/merge-gateway/routing/model-aliases): `"model": "@alias/<slug>"`.

## Next steps

#### [Using routing policies](/merge-gateway/routing/using-policies)

Precedence, failover codes, and inline priority lists

#### [Intelligent routing](/merge-gateway/routing/intelligent)

Match each prompt's complexity to a model

#### [Build Your Own Router](/merge-gateway/routing/build-your-own-router)

Route on the benchmarks you pick