> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Route requests

> Send traffic to a specific provider or swap the model, with routing rules

By default, the gateway sends each request to the provider that matches its format. **Routing rules**
override that. They let you send traffic to a specific provider or swap the model, without the
caller changing anything.

## How rules work

On the **Config** page, add rules under **Routing**. Each rule has two parts:

* **Match**: which requests it applies to.
  * **Incoming format**: `openai` or `anthropic`. Leave blank to match any.
  * **Model**: an exact model name. Leave blank to match any.
* **Target**: where matching requests go.
  * **Provider**: a connected provider to send to.
  * **Model**: an optional model to use instead of the one in the request.

Rules are evaluated top to bottom, and the **first match wins**. A request that matches no rule
passes through by format, as usual.

## Example

1. **Match** incoming format `openai`, model `gpt-4o`. **Target** provider `foundry_openai`, model `my-gpt-4o-deployment`.
2. **Match** incoming format `anthropic`. **Target** provider `foundry_anthropic`.

The first rule reroutes one specific model to an Azure deployment and renames it on the way. The
second sends all Anthropic traffic to Foundry. Everything else passes through by format.

## Common uses

* **Pin a provider**: send all traffic to one upstream, whatever the caller targets.
* **Swap a model**: map a public model name onto your own deployment name.
* **Mix providers**: route some models to one provider and the rest to another.

Routing to a provider whose format differs from the caller's triggers automatic translation. See
[Use any model from any SDK](/gateway/use-any-model).
