# Model aliases arrive in AI Gateway: one name, a whole pool of models

Hi, it's Shiichan! Here's a feature for when you want to swap the model behind your app without a redeploy.

## What was announced?

According to Cloudflare's Changelog, AI Gateway now supports model aliases.

An alias is one name for a pool of models, such as `custom/support-fast`, that your application calls.

## What changes

AI Gateway uses the models in the alias in one of two ways:

- It tries the models in the order you set and falls back to the next one if a request fails
- It uses smart routing to choose a model for each request

Your app only references the alias, so you can swap models or change the routing algorithm on the gateway alone. No redeploy needed!

## Dive Deep

You create and manage aliases on the gateway's Routing page, alongside dynamic routes.

To call an alias through the REST API, use its name as the `model`. In the changelog's example, you send a body like this to `/accounts/{account_id}/ai/run`:

```json
{
  "model": "custom/support-fast",
  "input": {
    "messages": [
      { "role": "user", "content": "Reply with a short greeting." }
    ]
  }
}
```

Include the `cf-aig-gateway-id` header to select the gateway where you created the alias. Aliases are scoped to individual gateways, so another gateway can't use them. For setup and routing options, see the Model aliases docs.

## Wrap-up

- Call a pool of models by one alias name
- Choose ordered fallback or smart routing
- Changing models or routing doesn't require redeploying the app
- Aliases are per gateway, and the REST API selects the gateway with the `cf-aig-gateway-id` header

This is for anyone juggling multiple LLM providers or wanting an escape hatch during failures!
