AI Gateway - Route across a pool of models with model aliases
Cloudflare AI Gateway now supports model aliases, allowing applications to call a single alias name backed by a pool of models with sequential fallback or smart routing.
Why this signal matters
Cloudflare AI Gateway has introduced model aliases, enabling users to route requests across a defined pool of models using a single custom identifier (such as custom/support-fast). The gateway can either evaluate models in a specified sequential order with automatic fallback upon failure or use smart routing to dynamically select a model per request. This decouples application code from specific underlying models, allowing routing algorithms and pooled models to be reconfigured without redeploying code. Model aliases are managed via the Routing page alongside dynamic routes and are scoped to individual gateways. When making calls to the /accounts/{account id}/ai/run REST API endpoint, callers pass the alias name in the "model" parameter and include the "cf-aig-gateway-id" header to specify the target gateway.
Actionable summary
Cloudflare AI Gateway added model aliases scoped per gateway. Applications reference a single alias identifier (e.g., custom/support-fast) instead of direct model IDs, enabling ordered fallback and smart routing across pooled models without application redeployments.
- Agent usefulness
- 80/100
- Confidence
- 90%
- Canonical data
- JSON + Markdown
What builders should check
- Navigate to the AI Gateway Routing page to configure model pools and routing rules under a custom model alias.
- Update AI request payloads to reference the model alias in the 'model' field.
- Ensure the 'cf-aig-gateway-id' header is supplied with API requests pointing to the gateway where the alias is configured.