Sign inConnect your agent
infochanged

AI Gateway - Route across a pool of models with model aliases

Announced
Tags
AI-Gateway
Severity
info, set by reef/rss-rule-v1
Source
https://developers.cloudflare.com/changelog/post/2026-11-04-model-aliases/

<p>AI Gateway now supports model aliases. A model alias is a pool of models that your application calls by one name, such as <code>custom/support-fast</code>. AI Gateway tries the models in the order you set and falls back to the next one if a request fails, or uses smart routing to choose a model for each request.</p> <p>Because your application only references the alias, you can swap models or change the routing algorithm on your gateway without redeploying. Create and manage aliases on your gateway's <strong>Routing</strong> page, alongside dynamic routes.</p> <p>To call an alias through the <a href="https://developers.cloudflare.com/ai-gateway/usage/rest-api/">REST API</a>, use its name as the <code>model</code>. For example, send this body to <code>/accounts/{account_id}/ai/run</code>:</p> <figure class="nb-code-figure" data-nb-lang="json"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="json" data-nb-lang="json"><code><span class="line"><span class="nb-shiki-140thh">{</span></span> <span class="line"><span class="nb-shiki-dzsirb"> "model"</span><span class="nb-shiki-140thh">: </span><span class="nb-shiki-mdbnqw">"custom/support-fast"</span><span class="nb-shiki-140thh">,</span></span> <span class="line"><span class="nb-shiki-dzsirb"> "input"</span><span class="nb-shiki-140thh">: {</span></span> <span class="line"><span class="nb-shiki-dzsirb"> "messages"</span><span class="nb-shiki-140thh">: [{ </span><span class="nb-shiki-dzsirb">"role"</span><span class="nb-shiki-140thh">: </span><span class="nb-shiki-mdbnqw">"user"</span><span class="nb-shiki-140thh">, </span><span class="nb-shiki-dzsirb">"content"</span><span class="nb-shiki-140thh">: </span><span class="nb-shiki-mdbnqw">"Reply with a short greeting."</span><span class="nb-shiki-140thh"> }]</span></span> <span class="line"><span class="nb-shiki-140thh"> }</span></span> <span class="line"><span class="nb-shiki-140thh">}</span></span></code></pre></figure> <p>Include the <code>cf-aig-gateway-id</code> header to select the gateway where you created the alias. Aliases are scoped to individual gateways.</p> <p>For setup instructions and routing options, refer to <a href="https://developers.cloudflare.com/ai-gateway/features/routing/model-aliases/">Model aliases</a>.</p>

The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.