#  Routing rules now available on AI Gateway

**Published:** July 2, 2026 | **Authors:** Rohan Taneja, Joe McKenney, Walter Korman

---

[Vercel AI Gateway](https://vercel.com/docs/ai-gateway) now supports [routing rules](https://vercel.com/docs/ai-gateway/models-and-providers/routing-rules).

Routing rules are firewall-style rules that control which models your team can use, applied at the gateway level instead of in your application code.

When a model goes down or gets retired, you usually have to ship a code change to move off it. With routing rules, you push one rule and every request reroutes instantly. There are two types:

| Type | What it does | Use it to |
| **Rewrite** | Serves a request for one model using another | Keep traffic flowing when a model is unavailable, migrate off a retired model, standardize on one model, or route an expensive model to a cheaper one |
| **Deny** | Blocks requests for a model | Keep your team off models you haven’t approved |

Rules apply to every request made with your team's AI Gateway credentials. You manage them with the [Vercel CLI](https://vercel.com/docs/ai-gateway/models-and-providers/routing-rules#manage-rules-with-the-cli).

### Rewrite

Create a rewrite with a source and a destination model. The Gateway swaps in the destination transparently, so your application keeps requesting the source model:

```bash
vercel ai-gateway rules add --type rewrite \
  --source anthropic/claude-opus-4.8 \
  --destination anthropic/claude-haiku-4.5
```

### Deny

Create a deny rule to block a model. Requests for it return a `403`:

```bash
vercel ai-gateway rules add --type deny --source openai/gpt-5.5
```

Rules only change which model serves a request. Everything else you’ve configured still applies to the destination model, including:

- **Request-level**: [BYOK](ttps://vercel.com/docs/ai-gateway/authentication-and-byok/byok), [model fallbacks](https://vercel.com/docs/ai-gateway/models-and-providers/model-fallbacks), [sorting](https://vercel.com/docs/ai-gateway/models-and-providers/provider-filtering-and-ordering),  the `only` [filter](https://vercel.com/docs/ai-gateway/models-and-providers/provider-filtering-and-ordering), and [provider options](https://vercel.com/docs/ai-gateway/models-and-providers/provider-options).
- **Team-level**: [Zero Data Retention](https://vercel.com/docs/ai-gateway/security-and-compliance/zdr) and the [provider allowlist](https://vercel.com/docs/ai-gateway/security-and-compliance/provider-allowlist).

Routing rules are in beta. For more information, read the [routing rules docs](https://vercel.com/docs/ai-gateway/models-and-providers/routing-rules).

---

📚 **More updates:** [View all changelog entries](/changelog/sitemap.md) | [Blog](/blog/sitemap.md)