<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Cloudflare changelogs | AI Gateway</title><description>Cloudflare changelogs for AI Gateway</description><link>https://developers.cloudflare.com/changelog/</link><item><title>AI Gateway - Review provider key activity in AI Gateway</title><link>https://developers.cloudflare.com/changelog/post/2026-11-06-provider-key-security/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-11-06-provider-key-security/</guid><description>&lt;p&gt;AI Gateway now shows usage activity for your stored provider keys. Use this information to review credentials for rotation or removal.&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;Provider Keys&lt;/strong&gt;, keys are grouped by provider with masked previews, aliases, and last-used and last-updated dates. The &lt;strong&gt;Key security&lt;/strong&gt; section highlights keys with recorded activity older than 90 days. You can review these keys and delete them after checking their dependencies.&lt;/p&gt;
&lt;p&gt;Usage tracking starts November 2026.&lt;/p&gt;
&lt;p&gt;For details on storing, rotating, and removing provider keys, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/&quot;&gt;Bring your own keys&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Fri, 06 Nov 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Route across a pool of models with model aliases</title><link>https://developers.cloudflare.com/changelog/post/2026-11-04-model-aliases/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-11-04-model-aliases/</guid><description>&lt;p&gt;AI Gateway now supports model aliases. A model alias is a pool of models that your application calls by one name, such as &lt;code&gt;custom/support-fast&lt;/code&gt;. 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.&lt;/p&gt;
&lt;p&gt;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&apos;s &lt;strong&gt;Routing&lt;/strong&gt; page, alongside dynamic routes.&lt;/p&gt;
&lt;p&gt;To call an alias through the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/rest-api/&quot;&gt;REST API&lt;/a&gt;, use its name as the &lt;code&gt;model&lt;/code&gt;. For example, send this body to &lt;code&gt;/accounts/{account_id}/ai/run&lt;/code&gt;:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;json&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot; data-nb-lang=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;model&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;custom/support-fast&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;input&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;		&quot;messages&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: [{ &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;&quot;role&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;Reply with a short greeting.&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; }]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Include the &lt;code&gt;cf-aig-gateway-id&lt;/code&gt; header to select the gateway where you created the alias. Aliases are scoped to individual gateways.&lt;/p&gt;
&lt;p&gt;For setup instructions and routing options, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/routing/model-aliases/&quot;&gt;Model aliases&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 04 Nov 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - New AI Gateways require authentication</title><link>https://developers.cloudflare.com/changelog/post/2026-11-03-required-authentication/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-11-03-required-authentication/</guid><description>&lt;p&gt;New AI Gateways now require authentication to prevent unauthorized requests. Once authentication is on, you cannot turn it off through the dashboard or API.&lt;/p&gt;
&lt;p&gt;When you create a new AI Gateway through the API, authentication is on by default. You can leave out the &lt;code&gt;authentication&lt;/code&gt; field or set it to &lt;code&gt;true&lt;/code&gt;. If you set it to &lt;code&gt;false&lt;/code&gt;, the API returns HTTP &lt;code&gt;400&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When you update an existing gateway, leaving out &lt;code&gt;authentication&lt;/code&gt; keeps its current setting. If you try to turn off authentication after it is on, the API returns HTTP &lt;code&gt;400&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Existing gateways with authentication turned off can continue without it. You can turn it on in your gateway settings or include &lt;code&gt;authentication: true&lt;/code&gt; in a &lt;a href=&quot;https://developers.cloudflare.com/api/resources/ai_gateway/methods/update/&quot;&gt;gateway update request&lt;/a&gt;:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;json&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot; data-nb-lang=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;authentication&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Before turning authentication on, configure HTTP clients to send a valid Cloudflare API token. Requests through Workers bindings remain pre-authenticated.&lt;/p&gt;
&lt;p&gt;For setup instructions and supported authorization headers, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/authentication/&quot;&gt;AI Gateway authentication&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 03 Nov 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>Agents, Workers AI, AI Gateway - createAI replaces workers-ai-provider and ai-gateway-provider</title><link>https://developers.cloudflare.com/changelog/post/2026-10-21-createai/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-10-21-createai/</guid><description>
&lt;p&gt;The Agents SDK has a new &lt;a href=&quot;https://developers.cloudflare.com/agents/models/&quot;&gt;&lt;code&gt;createAI&lt;/code&gt;&lt;/a&gt; function for the &lt;a href=&quot;https://developers.cloudflare.com/agents/models/ai-sdk/&quot;&gt;AI SDK&lt;/a&gt; and &lt;a href=&quot;https://developers.cloudflare.com/agents/models/pi-ai/&quot;&gt;Pi AI&lt;/a&gt;. It unifies what &lt;code&gt;workers-ai-provider&lt;/code&gt; and &lt;code&gt;ai-gateway-provider&lt;/code&gt; did: Workers AI models, AI Gateway catalog models, dynamic routes, and vendor models, through the &lt;code&gt;AI&lt;/code&gt; binding or an account id and API token.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;workers-ai-provider&lt;/code&gt; and &lt;code&gt;ai-gateway-provider&lt;/code&gt; are now feature frozen and marked as deprecated. Please migrate at your convenience.&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;sh&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot; data-nb-lang=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;npm&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; agents&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;div&gt;&lt;div data-nb-tabs data-nb-sync-key=&quot;workersExamples&quot; class&gt;&lt;div class=&quot;relative flex border-b border-border&quot; role=&quot;tablist&quot; data-nb-tabs-list&gt;&lt;span class=&quot;bg-primary pointer-events-none absolute -bottom-px h-0.5 rounded-t-sm transition-[left,width] duration-200 ease-out&quot; data-nb-tabs-indicator aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;mt-3&quot;&gt;&lt;div role=&quot;tabpanel&quot; data-nb-tabs-content data-nb-tab-label=&quot;JavaScript&quot; class&gt;&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;js&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot; data-nb-lang=&quot;js&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; { createAI } &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;agents/models/ai-sdk&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; { streamText } &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;ai&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; default&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;	async&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; fetch&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-1jdh33&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;nb-shiki-1jdh33&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;		const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; ai&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; createAI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({ binding: env.&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;AI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, id: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;my-gateway&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;		const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; result&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; streamText&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;			model: &lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;ai&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;anthropic/claude-opus-5.5&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;				fallback: [&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;@cf/zai-org/glm-4.7-flash&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;			}),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;			prompt: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;Write a haiku about Durable Objects&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;		return&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; result.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;toTextStreamResponse&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;&lt;div role=&quot;tabpanel&quot; data-nb-tabs-content data-nb-tab-label=&quot;TypeScript&quot; class&gt;&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;ts&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot; data-nb-lang=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; { createAI } &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;agents/models/ai-sdk&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; { streamText } &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;ai&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; default&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;	async&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; fetch&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-1jdh33&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; Request&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;nb-shiki-1jdh33&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; Env&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;		const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; ai&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; createAI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({ binding: env.&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;AI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, id: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;my-gateway&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;		const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; result&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; streamText&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;			model: &lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;ai&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;anthropic/claude-opus-5.5&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;				fallback: [&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;@cf/zai-org/glm-4.7-flash&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;			}),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;			prompt: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;Write a haiku about Durable Objects&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;		return&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; result.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;toTextStreamResponse&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;script type=&quot;module&quot; src=&quot;https://developers.cloudflare.com/home/runner/work/cloudflare-docs/cloudflare-docs/src/components/ui/tabs/Tabs.astro?astro&amp;type=script&amp;index=0&amp;lang.ts&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;p&gt;With &lt;code&gt;createAI&lt;/code&gt; you get:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Every model by id.&lt;/strong&gt; Workers AI &lt;code&gt;@cf/&lt;/code&gt; ids, any model in the &lt;a href=&quot;https://developers.cloudflare.com/ai/models/&quot;&gt;AI Gateway catalog&lt;/a&gt;, and &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/routing/dynamic-routing/&quot;&gt;dynamic routes&lt;/a&gt; as &lt;code&gt;dynamic/&amp;lt;route&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor model objects.&lt;/strong&gt; Pass a model from the vendor&apos;s own package, such as &lt;code&gt;ai(anthropic(&quot;claude-opus-5-5&quot;))&lt;/code&gt;. It goes unchanged to AI Gateway&apos;s &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/&quot;&gt;provider-native endpoint&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The binding, or an account id and API token.&lt;/strong&gt; Use a gateway in another account, or call from outside a Worker.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gateway options, fallback, and BYOK.&lt;/strong&gt; Caching, logging, metadata, retries, &lt;code&gt;byokAlias&lt;/code&gt;, &lt;code&gt;zdr&lt;/code&gt;, and &lt;code&gt;vendorKey&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stream resume.&lt;/strong&gt; Through the binding, a catalog or dynamic route stream that drops mid-answer resumes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other model types.&lt;/strong&gt; Embeddings, images, speech, transcription, and reranking in the AI SDK provider, and images in Pi AI.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;table-scroll&quot; tabindex=&quot;0&quot; role=&quot;region&quot; aria-label=&quot;Table&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;createWorkersAI({ binding })&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;createAI({ binding })&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;createWorkersAI({ accountId, apiKey })&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;createAI({ accountId, apiToken })&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;createAiGateway(...)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;createAI(...)&lt;/code&gt;, with &lt;code&gt;fallback&lt;/code&gt; for a list of models&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;createAISearch&lt;/code&gt; from &lt;code&gt;workers-ai-provider&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;createAISearchNamespace&lt;/code&gt; from &lt;code&gt;ai-search-provider&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;For AI Search, use &lt;a href=&quot;https://developers.cloudflare.com/ai-search/agent-sdks/ai-sdk/&quot;&gt;&lt;code&gt;ai-search-provider&lt;/code&gt;&lt;/a&gt;. For more information, refer to &lt;a href=&quot;https://developers.cloudflare.com/agents/models/&quot;&gt;Models&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 21 Oct 2026 00:00:00 GMT</pubDate><product>Agents</product><category>Agents</category><category>Workers AI</category><category>AI Gateway</category></item><item><title>AI Gateway - AI Gateway log IDs and request IDs now use UUIDv7</title><link>https://developers.cloudflare.com/changelog/post/2026-10-08-uuidv7-log-ids/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-10-08-uuidv7-log-ids/</guid><description>&lt;p&gt;New AI Gateway &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/observability/logging/&quot;&gt;log&lt;/a&gt; IDs and request IDs are lowercase UUIDv7, such as &lt;code&gt;019a7b3e-5f2c-7c41-9d3e-2b8f6a1c4e07&lt;/code&gt;. Previously, log IDs were 26-character ULIDs and request IDs were random UUIDs.&lt;/p&gt;
&lt;p&gt;For a request that AI Gateway answers in a single step, the &lt;code&gt;cf-aig-request-id&lt;/code&gt;, &lt;code&gt;cf-aig-log-id&lt;/code&gt;, and &lt;code&gt;cf-aig-event-id&lt;/code&gt; response headers now carry the same value. For provider and Universal requests, if you set your own &lt;code&gt;cf-aig-event-id&lt;/code&gt;, AI Gateway returns it instead.&lt;/p&gt;
&lt;p&gt;Existing log IDs do not change, and the &lt;a href=&quot;https://developers.cloudflare.com/api/resources/ai_gateway/subresources/logs/methods/list/&quot;&gt;logs API&lt;/a&gt; accepts both formats. Treat log IDs as opaque strings, and update any code that checks for the ULID format.&lt;/p&gt;</description><pubDate>Thu, 08 Oct 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Standardize provider credential error responses in AI Gateway</title><link>https://developers.cloudflare.com/changelog/post/2026-10-05-provider-credential-errors/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-10-05-provider-credential-errors/</guid><description>&lt;p&gt;AI Gateway&apos;s REST API now returns consistent responses when an AI provider rejects credentials. The change applies to &lt;a href=&quot;https://api.cloudflare.com/client/v4/accounts/%7BACCOUNT_ID%7D/ai/run&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;POST /ai/run&lt;/code&gt;&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;table-scroll&quot; tabindex=&quot;0&quot; role=&quot;region&quot; aria-label=&quot;Table&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Previous AI Gateway response&lt;/th&gt;
&lt;th&gt;New AI Gateway response&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ElevenLabs&lt;/td&gt;
&lt;td&gt;Provider-specific &lt;code&gt;UserCredentialsError&lt;/code&gt; with HTTP &lt;code&gt;403&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HTTP &lt;code&gt;401&lt;/code&gt; with error code &lt;code&gt;2009&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Vertex&lt;/td&gt;
&lt;td&gt;HTTP &lt;code&gt;500&lt;/code&gt; for rejected credentials, with upstream retries&lt;/td&gt;
&lt;td&gt;HTTP &lt;code&gt;401&lt;/code&gt; with error code &lt;code&gt;2009&lt;/code&gt;; the request fails without retrying the provider&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All other providers&lt;/td&gt;
&lt;td&gt;HTTP &lt;code&gt;402&lt;/code&gt; or another provider-specific status for rejected credentials&lt;/td&gt;
&lt;td&gt;HTTP &lt;code&gt;401&lt;/code&gt; with error code &lt;code&gt;2009&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When using &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;Unified Billing&lt;/a&gt;, the provider rejects the credentials&lt;/td&gt;
&lt;td&gt;Provider-specific authentication error&lt;/td&gt;
&lt;td&gt;HTTP &lt;code&gt;503&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Update applications that handle AI Gateway REST API errors to treat HTTP &lt;code&gt;401&lt;/code&gt; as an invalid or rejected provider credential.&lt;/p&gt;
&lt;p&gt;For details about providing provider credentials, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/&quot;&gt;Bring your own provider keys&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 06 Oct 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway, Web Search API - Introducing Web Search API</title><link>https://developers.cloudflare.com/changelog/post/2026-10-02-introducing-web-search-api/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-10-02-introducing-web-search-api/</guid><description>&lt;p&gt;&lt;a href=&quot;https://developers.cloudflare.com/web-search/&quot;&gt;Web Search API&lt;/a&gt; is now available in beta. Web Search API lets your AI agents and applications search the Internet and ground their responses in live information, instead of guessing URLs or relying on a model&apos;s training cutoff.&lt;/p&gt;
&lt;p&gt;At launch, you can choose between three search providers: &lt;a href=&quot;https://developers.cloudflare.com/web-search/providers/&quot;&gt;Ceramic.ai, Exa, and Linkup&lt;/a&gt;. All three support Zero Data Retention for requests made through Cloudflare, and all have committed to Cloudflare&apos;s &lt;a href=&quot;https://developers.cloudflare.com/bots/concepts/bot/verified-bots/&quot;&gt;verified bot&lt;/a&gt; crawling standards.&lt;/p&gt;
&lt;p&gt;Web Search API runs through &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/&quot;&gt;AI Gateway&lt;/a&gt;, so search requests appear in your gateway logs and are billed to your AI Gateway credits at each provider&apos;s list API price, with no additional markup. You can also bring your own provider API key.&lt;/p&gt;
&lt;p&gt;Call Web Search API with the REST API:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; https://api.cloudflare.com/client/v4/accounts/&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_ACCOUNT_ID&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;/ai/websearch/&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --request&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; POST&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_API_TOKEN&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Content-Type: application/json&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;query&quot;: &quot;What are some fun things to do in Salt Lake City as fall approaches?&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;provider&quot;: &quot;ceramic&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;limit&quot;: 5,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;options&quot;: { &quot;gateway&quot;: { &quot;id&quot;: &quot;default&quot; } }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;  }&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Or from a Worker with the AI binding:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;ts&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot; data-nb-lang=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; await&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; env.&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;AI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;websearch&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	gatewayId: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	query: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;What are some fun things to do in Salt Lake City as fall approaches?&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	provider: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;exa&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	limit: &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; results&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; await&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; response.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;To get started, refer to &lt;a href=&quot;https://developers.cloudflare.com/web-search/how-to-use/&quot;&gt;How to use Web Search API&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Fri, 02 Oct 2026 13:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category><category>Web Search API</category></item><item><title>AI Gateway - Pay for AI inference with Machine Payments</title><link>https://developers.cloudflare.com/changelog/post/2026-09-30-machine-payments/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-09-30-machine-payments/</guid><description>&lt;p&gt;AI Gateway now supports Machine Payments in beta. With Machine Payments, clients can use the x402 protocol to pay for eligible inference requests directly from a stablecoin wallet instead of maintaining a prepaid credit balance.&lt;/p&gt;
&lt;p&gt;Machine Payments is available for the &lt;code&gt;/ai/run&lt;/code&gt; endpoint with select open models. To request x402 payment, authenticate with a Cloudflare API token and include the Cloudflare-specific &lt;code&gt;Payment-Method: x402&lt;/code&gt; header:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; -iX&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; POST&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;https://api.cloudflare.com/client/v4/accounts/&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_ACCOUNT_ID&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;/ai/run&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_API_TOKEN&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Payment-Method: x402&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Content-Type: application/json&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;model&quot;: &quot;z-ai/glm-4.7-flash&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;input&quot;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;      &quot;messages&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;          &quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;          &quot;content&quot;: &quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;      ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;  }&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;An x402-compatible client handles the payment challenge, signs an authorization from the client&apos;s wallet, and retries the request. Machine Payments currently requires customers to be based in the United States and have a credit card on file.&lt;/p&gt;
&lt;p&gt;For prerequisites, eligible models, and transaction details, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/machine-payments/&quot;&gt;Machine Payments (x402)&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 30 Sep 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Identify model overuse and potential savings with User Insights</title><link>https://developers.cloudflare.com/changelog/post/2026-09-29-user-insights-task-analysis/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-09-29-user-insights-task-analysis/</guid><description>&lt;p&gt;AI Gateway User Insights now gives you more context about the traffic flowing through your gateway. It shows what users and agents are doing with AI, and where a selected model may be more capable than a task requires.&lt;/p&gt;
&lt;p&gt;On the analysis side, User Insights groups conversations by task, tracks conversation turns, and helps you compare model fit with cost and latency.&lt;/p&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=1434,height=606,format=webp/_astro/user-insights-task-analysis.CS2pm7wg.png&quot; alt=&quot;User Insights task and model analysis grouped by task categories&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1434&quot; height=&quot;606&quot;&gt;
&lt;p&gt;The Potential Savings view highlights requests that may work with faster or less expensive models without compromising output quality. These are the same signals that Cloudflare&apos;s &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/routing/auto-router/&quot;&gt;Auto Router&lt;/a&gt; uses to select a model based on task and cost.&lt;/p&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=1506,height=669,format=webp/_astro/user-insights-potential-savings.C7j_Gjcn.png&quot; alt=&quot;Potential Savings view comparing tasks and suggested models&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1506&quot; height=&quot;669&quot;&gt;
&lt;p&gt;These new insights are available to all AI Gateway customers at no additional cost. For more information, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/observability/user-insights/&quot;&gt;User Insights&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 29 Sep 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Prevent Unified Billing fallback for BYOK third-party providers</title><link>https://developers.cloudflare.com/changelog/post/2026-09-14-require-provider-credentials/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-09-14-require-provider-credentials/</guid><description>&lt;p&gt;AI Gateway can now require credentials for third-party provider requests. Credentials must accompany the request or be stored on the gateway. This setting prevents fallback to Unified Billing with Cloudflare-managed credentials.&lt;/p&gt;
&lt;p&gt;Turn on &lt;strong&gt;Require provider credentials&lt;/strong&gt; in your gateway settings. To use the API, set &lt;code&gt;byok_only&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in the request body of a &lt;a href=&quot;https://developers.cloudflare.com/api/resources/ai_gateway/methods/update/&quot;&gt;&lt;code&gt;PUT&lt;/code&gt; request to update the gateway&lt;/a&gt;:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;json&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot; data-nb-lang=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;byok_only&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;To require provider credentials for one third-party request, set the &lt;code&gt;cf-aig-no-wholesale&lt;/code&gt; header to &lt;code&gt;true&lt;/code&gt;. This header cannot relax the gateway setting.&lt;/p&gt;
&lt;p&gt;Requests without applicable credentials then return an HTTP &lt;code&gt;400&lt;/code&gt; response. Workers AI requests remain allowed, and the setting does not change their configured billing mode.&lt;/p&gt;
&lt;p&gt;For configuration details and request-level controls, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/#prevent-unified-billing-fallback-for-byok-third-party-providers&quot;&gt;Prevent Unified Billing fallback for BYOK third-party providers&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - AI Gateway custom costs support cache tokens</title><link>https://developers.cloudflare.com/changelog/post/2026-09-09-custom-cache-token-costs/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-09-09-custom-cache-token-costs/</guid><description>&lt;p&gt;AI Gateway custom costs now support cache-read and cache-write token rates. This lets custom cost metrics reflect negotiated cache pricing across providers.&lt;/p&gt;
&lt;p&gt;Add &lt;code&gt;per_cache_read_token&lt;/code&gt; or &lt;code&gt;per_cache_write_token&lt;/code&gt; to the &lt;code&gt;cf-aig-custom-cost&lt;/code&gt; header:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;json&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot; data-nb-lang=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;per_token_in&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;0.000001&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;per_token_out&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;0.000002&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;per_cache_read_token&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;0.0000001&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	&quot;per_cache_write_token&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;0.0000005&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Cache-token pricing activates when either cache rate is present. An omitted cache rate defaults to &lt;code&gt;per_token_in&lt;/code&gt;. If both cache rates are omitted, AI Gateway preserves the existing input and output calculation.&lt;/p&gt;
&lt;p&gt;Providers can include cache tokens within input tokens or report them separately. AI Gateway automatically accounts for these differences and prevents double-counting.&lt;/p&gt;
&lt;p&gt;For more information, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/custom-costs/&quot;&gt;Custom costs&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 09 Sep 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - AI Gateway consolidates monthly usage invoice line items and standardizes model names</title><link>https://developers.cloudflare.com/changelog/post/2026-09-01-billing-and-model-names/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-09-01-billing-and-model-names/</guid><description>&lt;p&gt;AI Gateway monthly usage invoices, issued at the beginning of each month for the previous month&apos;s usage, now show a single total cost for each model. These invoices no longer break out input and output token quantities and unit prices into separate line items. This change does not apply to invoices for AI Gateway credit purchases.&lt;/p&gt;
&lt;p&gt;For example, an invoice that previously included these separate line items:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;anthropic claude-haiku-4-5-20251001 Input Tokens&lt;/code&gt;: 40,000 tokens at $0.000001 ($0.04)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;anthropic claude-haiku-4-5-20251001 Output Tokens&lt;/code&gt;: 24,000 tokens at $0.000005 ($0.12)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The updated invoice includes one line item: &lt;code&gt;anthropic/claude-haiku-4.5&lt;/code&gt;: $0.16.&lt;/p&gt;
&lt;p&gt;AI Gateway has also standardized model names across invoices and logs. Model variants that previously appeared with provider-specific version suffixes now use a consistent &lt;code&gt;provider/model&lt;/code&gt; identifier.&lt;/p&gt;
&lt;p&gt;For more information, refer to the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;Unified Billing documentation&lt;/a&gt; and &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/observability/logging/&quot;&gt;AI Gateway logging documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 01 Sep 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Get 50% off GPT-5.6 Sol through AI Gateway</title><link>https://developers.cloudflare.com/changelog/post/2026-08-19-gpt-5-6-sol-discount/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-08-19-gpt-5-6-sol-discount/</guid><description>&lt;p&gt;GPT-5.6 Sol is available through AI Gateway, and for a limited time you can use it at 50% off. If you are already using AI Gateway, point to the &lt;code&gt;openai/gpt-5.6-sol&lt;/code&gt; model and the discounted pricing applies automatically — no promo code needed.&lt;/p&gt;
&lt;p&gt;The promotion is available for &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;Unified Billing&lt;/a&gt; users only (not &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/&quot;&gt;Bring Your Own Keys&lt;/a&gt;). Load credits onto AI Gateway and start sending requests to &lt;code&gt;openai/gpt-5.6-sol&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Discounted pricing during the promotion:&lt;/p&gt;
&lt;div class=&quot;table-scroll&quot; tabindex=&quot;0&quot; role=&quot;region&quot; aria-label=&quot;Table&quot;&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Usage&lt;/th&gt;
&lt;th&gt;Promotional price&lt;/th&gt;
&lt;th&gt;Standard price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Input&lt;/td&gt;
&lt;td&gt;$2.50 per 1M tokens&lt;/td&gt;
&lt;td&gt;$5 per 1M tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;$15 per 1M tokens&lt;/td&gt;
&lt;td&gt;$30 per 1M tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cache read&lt;/td&gt;
&lt;td&gt;$0.25 per 1M tokens&lt;/td&gt;
&lt;td&gt;$0.50 per 1M tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;The promotion runs through September 18, 2026. After that date, GPT-5.6 Sol requests return to standard pricing.&lt;/p&gt;
&lt;p&gt;For more details, refer to the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;Unified Billing documentation&lt;/a&gt; and the &lt;a href=&quot;https://developers.cloudflare.com/ai/models/openai/gpt-5.6-sol/&quot;&gt;GPT-5.6 Sol model page&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 19 Aug 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway, Workers AI - Workers AI and AI Gateway unify model access and billing</title><link>https://developers.cloudflare.com/changelog/post/2026-08-07-workers-ai-unified-billing/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-08-07-workers-ai-unified-billing/</guid><description>
&lt;p&gt;Workers AI and AI Gateway now provide a unified path for accessing models and managing inference traffic. Use the same AI binding and REST API to call models hosted on Workers AI or by supported third-party providers, with AI Gateway providing observability, logging, caching, security, and billing controls.&lt;/p&gt;
&lt;div tabindex=&quot;-1&quot; class=&quot;heading-wrapper level-h4&quot;&gt;&lt;h4 id=&quot;unified-entrypoints-and-observability&quot;&gt;Unified entrypoints and observability&lt;/h4&gt;&lt;a class=&quot;anchor-link&quot; href=&quot;#unified-entrypoints-and-observability&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;anchor-icon&quot;&gt;&lt;svg width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentcolor&quot; d=&quot;m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;The &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/&quot;&gt;AI binding&lt;/a&gt; supports both Workers AI and third-party models through &lt;code&gt;env.AI.run()&lt;/code&gt;. The &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/rest-api/&quot;&gt;REST API&lt;/a&gt; provides shared &lt;code&gt;/ai/&lt;/code&gt; endpoints with Cloudflare authentication across providers.&lt;/p&gt;
&lt;p&gt;Route a Workers AI request through AI Gateway by specifying a gateway ID. Use &lt;code&gt;default&lt;/code&gt; to automatically create a gateway on the first authenticated request, or specify an existing gateway to separate applications and workloads:&lt;/p&gt;
&lt;div&gt;&lt;div data-nb-tabs data-nb-sync-key=&quot;workersExamples&quot; class&gt;&lt;div class=&quot;relative flex border-b border-border&quot; role=&quot;tablist&quot; data-nb-tabs-list&gt;&lt;span class=&quot;bg-primary pointer-events-none absolute -bottom-px h-0.5 rounded-t-sm transition-[left,width] duration-200 ease-out&quot; data-nb-tabs-indicator aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;mt-3&quot;&gt;&lt;div role=&quot;tabpanel&quot; data-nb-tabs-content data-nb-tab-label=&quot;JavaScript&quot; class&gt;&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;js&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot; data-nb-lang=&quot;js&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; await&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; env.&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;AI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;	&quot;@cf/zai-org/glm-5.2&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		messages: [{ role: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, content: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;What is the capital of France?&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; }],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		gateway: { id: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;&lt;div role=&quot;tabpanel&quot; data-nb-tabs-content data-nb-tab-label=&quot;TypeScript&quot; class&gt;&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;ts&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot; data-nb-lang=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; await&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; env.&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;AI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;	&quot;@cf/zai-org/glm-5.2&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		messages: [{ role: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, content: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;What is the capital of France?&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; }],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		gateway: { id: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;script type=&quot;module&quot; src=&quot;https://developers.cloudflare.com/home/runner/work/cloudflare-docs/cloudflare-docs/src/components/ui/tabs/Tabs.astro?astro&amp;type=script&amp;index=0&amp;lang.ts&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;p&gt;Requests routed through AI Gateway can be logged and included in analytics for request volume, errors, latency, token usage, and costs. You can also configure controls such as caching, rate limiting, and request retries on the gateway.&lt;/p&gt;
&lt;div tabindex=&quot;-1&quot; class=&quot;heading-wrapper level-h4&quot;&gt;&lt;h4 id=&quot;unified-billing-and-higher-rate-limits&quot;&gt;Unified billing and higher rate limits&lt;/h4&gt;&lt;a class=&quot;anchor-link&quot; href=&quot;#unified-billing-and-higher-rate-limits&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;anchor-icon&quot;&gt;&lt;svg width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path fill=&quot;currentcolor&quot; d=&quot;m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;You can now use prepaid &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;AI Gateway credits&lt;/a&gt; to pay for Workers AI inference. This provides one credit balance for Workers AI and supported third-party model providers. To use credits for Workers AI, set the gateway&apos;s &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/manage-gateway/#configure-workers-ai-billing&quot;&gt;Workers AI billing setting&lt;/a&gt; to &lt;strong&gt;Unified billing&lt;/strong&gt;. Workers AI requests routed through that gateway deduct from your credit balance in real time.&lt;/p&gt;
&lt;p&gt;Prepaid credits also provide access to the following Workers AI frontier models without requiring the Workers Paid plan. Each frontier Workers AI model has a rate limit of 50 requests per minute per account, per model when billed with AI Gateway credits, compared to 20 requests per minute through standard Workers AI billing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/workers-ai/models/kimi-k2.6/&quot;&gt;&lt;code&gt;@cf/moonshotai/kimi-k2.6&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/workers-ai/models/kimi-k2.7-code/&quot;&gt;&lt;code&gt;@cf/moonshotai/kimi-k2.7-code&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/workers-ai/models/glm-5.2/&quot;&gt;&lt;code&gt;@cf/zai-org/glm-5.2&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These limits are designed for typical agentic and coding workloads, where requests to frontier models can take longer to complete.&lt;/p&gt;
&lt;p&gt;For details, refer to &lt;a href=&quot;https://developers.cloudflare.com/workers-ai/platform/limits/&quot;&gt;Workers AI limits&lt;/a&gt;, &lt;a href=&quot;https://developers.cloudflare.com/workers-ai/platform/pricing/&quot;&gt;Workers AI pricing&lt;/a&gt;, &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;Unified Billing&lt;/a&gt;, and the &lt;a href=&quot;https://developers.cloudflare.com/ai/models/&quot;&gt;AI Gateway model catalog&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Fri, 07 Aug 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category><category>Workers AI</category></item><item><title>AI Gateway - Track AI spend and catch anomalous usage with User Insights</title><link>https://developers.cloudflare.com/changelog/post/2026-08-05-user-insights/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-08-05-user-insights/</guid><description>&lt;p&gt;AI Gateway now includes User Insights, a dashboard that gives you two things at once: clear visibility into how much your organization spends on AI, and a security signal that surfaces users whose usage suddenly looks abnormal. It works on the traffic already flowing through your gateway, so there is no additional setup.&lt;/p&gt;
&lt;p&gt;On the spend side, User Insights shows organization-wide totals for cost, requests, tokens, and adoption, and lets you drill into an individual user to see their spend, top models and providers, cache hit rate, and more. To attribute usage to individual users, add a user identifier with custom metadata or put your gateway behind Cloudflare Access.&lt;/p&gt;
&lt;p&gt;On the security side, User Insights baselines each user&apos;s normal usage from their 95th percentile (p95) session cost over the last 30 days, then flags sessions that exceed both that baseline and an organization-level threshold. A sudden jump above a user&apos;s own pattern is often the first sign of a compromised credential or a misbehaving agent, so you can investigate before it shows up on your bill.&lt;/p&gt;
&lt;p&gt;User Insights is available to all AI Gateway customers at no additional cost.&lt;/p&gt;</description><pubDate>Wed, 05 Aug 2026 20:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway, Access - Identity-aware controls are now available in AI Gateway</title><link>https://developers.cloudflare.com/changelog/post/2026-08-05-access-user-id-metadata/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-08-05-access-user-id-metadata/</guid><description>&lt;p&gt;AI Gateway now integrates with Cloudflare Access, giving you two new capabilities:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Protect your gateway endpoint.&lt;/strong&gt; Put your AI Gateway behind Access so you can set policies that control who is allowed to call a specific gateway&apos;s endpoint.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Identity-aware controls.&lt;/strong&gt; When traffic reaches AI Gateway through an Access-protected custom domain, AI Gateway can use the authenticated user&apos;s Access identity in logs, analytics, routing, and spend controls.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With identity-aware controls, you can set spend limits by authenticated user, control which gateways different users can access, filter logs by user, and build policies without passing user IDs from the client application. AI Gateway adds the verified Access user ID to request metadata as &lt;code&gt;cf.user_id&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For setup instructions, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/cloudflare-access/&quot;&gt;Cloudflare Access&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 05 Aug 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category><category>Access</category></item><item><title>AI Gateway - View the user agent of requests in AI Gateway logs</title><link>https://developers.cloudflare.com/changelog/post/2026-06-12-user-agent-logging/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-06-12-user-agent-logging/</guid><description>&lt;p&gt;AI Gateway logs now capture the user agent of the client that made each request, making it easier to identify which SDK, library, or application sent the traffic flowing through your gateway. For example, you can tell apart requests coming from &lt;code&gt;openai-python&lt;/code&gt; versus a custom application or a Cloudflare Worker.&lt;/p&gt;
&lt;p&gt;The user agent appears alongside the other details in each log entry, and you can filter logs by user agent (equals, does not equal, or contains) in the dashboard.&lt;/p&gt;
&lt;p&gt;For more information, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/observability/logging/&quot;&gt;Logging&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Fri, 12 Jun 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Control AI costs with spend limits</title><link>https://developers.cloudflare.com/changelog/post/2026-06-05-spend-limits/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-06-05-spend-limits/</guid><description>&lt;p&gt;AI Gateway now supports spend limits — cost-based budgets that track cumulative dollar spend and block requests when the budget is exceeded. Unlike rate limiting, which caps the number of requests, spend limits track actual cost based on token usage and model pricing.&lt;/p&gt;
&lt;p&gt;You can scope limits by model, provider, or custom metadata dimensions. For example, give each user a $200/day budget, cap total gateway spend at $10,000/day, or limit a specific model to $50/day per user. Each rule uses a configurable time window with fixed or sliding enforcement.&lt;/p&gt;
&lt;p&gt;Spend limits work with both &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;Unified Billing&lt;/a&gt; and &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/&quot;&gt;BYOK&lt;/a&gt; requests for models with known pricing.&lt;/p&gt;
&lt;p&gt;For more details, refer to the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/spend-limits/&quot;&gt;Spend limits documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Fri, 05 Jun 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Call any AI model through AI Gateway&apos;s new REST API</title><link>https://developers.cloudflare.com/changelog/post/2026-05-21-rest-api/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-05-21-rest-api/</guid><description>&lt;p&gt;AI Gateway now uses the AI REST API on &lt;code&gt;api.cloudflare.com&lt;/code&gt;. You can call any model — whether from OpenAI, Anthropic, Google, or hosted on Workers AI — through one unified API, using the same endpoints and authentication regardless of provider. Four endpoints are available:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POST /ai/run&lt;/code&gt; — universal endpoint for all models and modalities&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /ai/v1/chat/completions&lt;/code&gt; — OpenAI SDK compatible&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /ai/v1/responses&lt;/code&gt; — OpenAI Responses API compatible&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /ai/v1/messages&lt;/code&gt; — Anthropic SDK compatible&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; -X&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; POST&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;https://api.cloudflare.com/client/v4/accounts/&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_ACCOUNT_ID&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;/ai/v1/chat/completions&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_API_TOKEN&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Content-Type: application/json&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;model&quot;: &quot;openai/gpt-5.5&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;What is Cloudflare?&quot;}]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;  }&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;All AI Gateway features — logging, caching, rate limiting, and guardrails — are applied automatically. Third-party models are billed through &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/unified-billing/&quot;&gt;Unified Billing&lt;/a&gt;, so you do not need to manage separate provider API keys.&lt;/p&gt;
&lt;p&gt;Third-party model requests are routed through your account&apos;s default gateway, which is created automatically on first use. To route requests through a specific gateway, add the &lt;code&gt;cf-aig-gateway-id&lt;/code&gt; header.&lt;/p&gt;
&lt;p&gt;If you are already calling Workers AI models through the existing REST API, that path (&lt;code&gt;/ai/run/@cf/{model}&lt;/code&gt;) continues to work. To call Workers AI models through AI Gateway, use the &lt;code&gt;@cf/&lt;/code&gt; model prefix (for example, &lt;code&gt;@cf/moonshotai/kimi-k2.6&lt;/code&gt;) and include the &lt;code&gt;cf-aig-gateway-id&lt;/code&gt; header to specify which gateway to route through.&lt;/p&gt;
&lt;p&gt;For more details and examples, refer to the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/rest-api/&quot;&gt;REST API documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Thu, 21 May 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Automatically retry on upstream provider failures on AI Gateway</title><link>https://developers.cloudflare.com/changelog/post/2026-04-02-auto-retry-upstream-failures/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-04-02-auto-retry-upstream-failures/</guid><description>&lt;p&gt;AI Gateway now supports automatic retries at the gateway level. When an upstream provider returns an error, your gateway retries the request based on the retry policy you configure, without requiring any client-side changes.&lt;/p&gt;
&lt;p&gt;You can configure the retry count (up to 5 attempts), the delay between retries (from 100ms to 5 seconds), and the backoff strategy (Constant, Linear, or Exponential). These defaults apply to all requests through the gateway, and per-request headers can override them.&lt;/p&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=2344,height=502,format=webp/_astro/auto-retry-changelog.DoCXZnDy.png&quot; alt=&quot;Retry Requests settings in the AI Gateway dashboard&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2344&quot; height=&quot;502&quot;&gt;
&lt;p&gt;This is particularly useful when you do not control the client making the request and cannot implement retry logic on the caller side. For more complex failover scenarios — such as failing across different providers — use &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/routing/dynamic-routing/&quot;&gt;Dynamic Routing&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For more information, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/manage-gateway/#retry-requests&quot;&gt;Manage gateways&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Thu, 02 Apr 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Log AI Gateway request metadata without storing payloads</title><link>https://developers.cloudflare.com/changelog/post/2026-03-17-collect-log-payload-header/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-03-17-collect-log-payload-header/</guid><description>&lt;p&gt;AI Gateway now supports the &lt;code&gt;cf-aig-collect-log-payload&lt;/code&gt; header, which controls whether request and response bodies are stored in logs. By default, this header is set to &lt;code&gt;true&lt;/code&gt; and payloads are stored alongside metadata. Set this header to &lt;code&gt;false&lt;/code&gt; to skip payload storage while still logging metadata such as token counts, model, provider, status code, cost, and duration.&lt;/p&gt;
&lt;p&gt;This is useful when you need usage metrics but do not want to persist sensitive prompt or response data.&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; https://gateway.ai.cloudflare.com/v1/&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$ACCOUNT_ID&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$GATEWAY_ID&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;/openai/chat/completions&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$TOKEN&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;Content-Type: application/json&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;cf-aig-collect-log-payload: false&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;model&quot;: &quot;gpt-4o-mini&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;messages&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        &quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        &quot;content&quot;: &quot;What is the email address and phone number of user123?&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;  }&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;For more information, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/observability/logging/#collect-log-payload-cf-aig-collect-log-payload&quot;&gt;Logging&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 17 Mar 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Get started with AI Gateway automatically</title><link>https://developers.cloudflare.com/changelog/post/2026-03-02-default-gateway/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-03-02-default-gateway/</guid><description>&lt;p&gt;You can now start using AI Gateway with a single API call — no setup required. Use &lt;code&gt;default&lt;/code&gt; as your gateway ID, and AI Gateway creates one for you automatically on the first request.&lt;/p&gt;
&lt;p&gt;To try it out, &lt;a href=&quot;https://developers.cloudflare.com/fundamentals/api/get-started/create-token/&quot;&gt;create an API token&lt;/a&gt; with &lt;code&gt;AI Gateway - Read&lt;/code&gt;, &lt;code&gt;AI Gateway - Edit&lt;/code&gt;, and &lt;code&gt;Workers AI - Read&lt;/code&gt; permissions, then run:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; -X&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; POST&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; https://gateway.ai.cloudflare.com/v1/&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_ACCOUNT_ID&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;/default/compat/chat/completions&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;cf-aig-authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;$CLOUDFLARE_API_TOKEN&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;Content-Type: application/json&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;  --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;model&quot;: &quot;workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;messages&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        &quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        &quot;content&quot;: &quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;  }&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;AI Gateway gives you logging, caching, rate limiting, and access to multiple AI providers through a single endpoint. For more information, refer to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/get-started/&quot;&gt;Get started&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Mon, 02 Mar 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway, Workers AI - AI dashboard experience improvements</title><link>https://developers.cloudflare.com/changelog/post/2026-02-19-ai-dashboard-experience-improvements/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2026-02-19-ai-dashboard-experience-improvements/</guid><description>&lt;p&gt;&lt;a href=&quot;https://developers.cloudflare.com/workers-ai/&quot;&gt;Workers AI&lt;/a&gt; and &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/&quot;&gt;AI Gateway&lt;/a&gt; have received a series of dashboard improvements to help you get started faster and manage your AI workloads more easily.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Navigation and discoverability&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;AI now has its own top-level section in the Cloudflare dashboard sidebar, so you can find AI features without digging through menus.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=2328,height=1140,format=webp/_astro/sidebar-navigation.BQNFBmAk.png&quot; alt=&quot;AI sidebar navigation in the Cloudflare dashboard&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2328&quot; height=&quot;1140&quot;&gt;
&lt;em&gt;The new top-level AI section in the dashboard sidebar.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Onboarding and getting started&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/get-started/&quot;&gt;Getting started&lt;/a&gt; with AI Gateway is now simpler. When you create your first gateway, we now show your gateway&apos;s OpenAI-compatible endpoint and step-by-step guidance to help you configure it. The Playground also includes helpful prompts, and usage pages have clear next steps if you have not made any requests yet.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=2400,height=1232,format=webp/_astro/onboarding-flow.DZ7aMcHa.png&quot; alt=&quot;AI Gateway onboarding flow&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2400&quot; height=&quot;1232&quot;&gt;
&lt;em&gt;The first-run setup experience for new gateways.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We&apos;ve also combined the previously separate code example sections into one view with dropdown selectors for API type, provider, SDK, and authentication method so you can now customize the exact code snippet you need from one place.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dynamic Routing&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/routing/dynamic-routing/&quot;&gt;route builder&lt;/a&gt; is now more performant and responsive.&lt;/li&gt;
&lt;li&gt;You can now copy route names to your clipboard with a single click.&lt;/li&gt;
&lt;li&gt;Code examples use the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/universal/&quot;&gt;Universal Endpoint&lt;/a&gt; format, making it easier to integrate routes into your application.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Observability and analytics&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Small monetary values now display correctly in &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/observability/costs/&quot;&gt;cost analytics&lt;/a&gt; charts, so you can accurately track spending at any scale.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Improvements to keyboard navigation within the AI Gateway, specifically when exploring usage by &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/&quot;&gt;provider&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Improvements to sorting and filtering components on the &lt;a href=&quot;https://developers.cloudflare.com/workers-ai/models/&quot;&gt;Workers AI&lt;/a&gt; models page.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information, refer to the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/&quot;&gt;AI Gateway documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Thu, 19 Feb 2026 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category><category>Workers AI</category></item><item><title>Secrets Store, AI Gateway, SSL/TLS - Manage and deploy your AI provider keys through Bring Your Own Key (BYOK) with AI Gateway, now powered by Cloudflare Secrets Store</title><link>https://developers.cloudflare.com/changelog/post/2025-08-25-secrets-store-ai-gateway/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-08-25-secrets-store-ai-gateway/</guid><description>
&lt;p&gt;Cloudflare Secrets Store is now integrated with AI Gateway, allowing you to store, manage, and deploy your AI provider keys in a secure and seamless configuration through &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Bring Your Own Key&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;. Instead of passing your AI provider keys directly in every request header, you can centrally manage each key with Secrets Store and deploy in your gateway configuration using only a reference, rather than passing the value in plain text.&lt;/p&gt;
&lt;p&gt;You can now create a secret directly from your AI Gateway &lt;a href=&quot;http://dash.cloudflare.com/?to=/:account/ai-gateway&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;in the dashboard&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt; by navigating into your gateway -&amp;gt; &lt;strong&gt;Provider Keys&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=2410,height=1842,format=webp/_astro/add-secret-ai-gateway.B-SIPr6s.png&quot; alt=&quot;Import repo or choose template&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2410&quot; height=&quot;1842&quot;&gt;
&lt;p&gt;You can also create your secret with the newly available &lt;strong&gt;ai_gateway&lt;/strong&gt; scope via &lt;a href=&quot;https://developers.cloudflare.com/workers/wrangler/commands/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;wrangler&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;, the &lt;a href=&quot;http://dash.cloudflare.com/?to=/:account/secrets-store&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Secrets Store dashboard&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;, or the &lt;a href=&quot;https://developers.cloudflare.com/api/resources/secrets_store/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;API&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then, pass the key in the request header using its Secrets Store reference:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; -X&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; POST&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; https://gateway.ai.cloudflare.com/v1/&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;ACCOUNT_I&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;D&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;/my-gateway/anthropic/v1/messages&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;cf-aig-authorization: ANTHROPIC_KEY_1 \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; --header &apos;anthropic-version:&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; 2023-06-01&apos; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; --header &apos;Content-Type:&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; application/json&apos; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; --data  &apos;{&quot;model&quot;:&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;claude-3-opus-20240229&quot;,&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;messages&quot;:&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; [{&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;&quot;role&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;user&quot;,&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;content&quot;:&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;What is Cloudflare?&quot;}]}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Or, using Javascript:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure&quot; data-nb-lang=&quot;plaintext&quot;&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot; data-nb-lang=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;import Anthropic from &apos;@anthropic-ai/sdk&apos;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;const anthropic = new Anthropic({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt; apiKey: &quot;ANTHROPIC_KEY_1&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt; baseURL: &quot;https://gateway.ai.cloudflare.com/v1/&amp;lt;ACCOUNT_ID&amp;gt;/my-gateway/anthropic&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;const message = await anthropic.messages.create({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt; model: &apos;claude-3-opus-20240229&apos;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt; messages: [{role: &quot;user&quot;, content: &quot;What is Cloudflare?&quot;}],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt; max_tokens: 1024&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-wvjl67&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;For more information, check out the &lt;a href=&quot;https://blog.cloudflare.com/ai-gateway-aug-2025-refresh&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;blog&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;!&lt;/p&gt;</description><pubDate>Mon, 25 Aug 2025 11:00:00 GMT</pubDate><product>Secrets Store</product><category>Secrets Store</category><category>AI Gateway</category><category>SSL/TLS</category></item><item><title>AI Gateway - AI Gateway adds OpenAI compatible endpoint</title><link>https://developers.cloudflare.com/changelog/post/2025-06-03-aig-openai-compatible-endpoint/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-06-03-aig-openai-compatible-endpoint/</guid><description>&lt;p&gt;Users can now use an &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/chat-completion/&quot;&gt;OpenAI Compatible endpoint&lt;/a&gt; in AI Gateway to easily switch between providers, while keeping the exact same request and response formats. We&apos;re launching now with the chat completions endpoint, with the embeddings endpoint coming up next.&lt;/p&gt;
&lt;p&gt;To get started, use the OpenAI compatible chat completions endpoint URL with your own account id and gateway id and switch between providers by changing the &lt;code&gt;model&lt;/code&gt; and &lt;code&gt;apiKey&lt;/code&gt; parameters.&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure nb-code-figure-titled&quot; data-nb-lang=&quot;js&quot;&gt;&lt;figcaption class=&quot;nb-code-title&quot; data-pagefind-ignore=&quot;&quot;&gt;&lt;span class=&quot;nb-code-title-name&quot;&gt;OpenAI SDK Example&lt;/span&gt;&lt;span class=&quot;nb-code-title-lang&quot;&gt;js&lt;/span&gt;&lt;/figcaption&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;js&quot; data-nb-lang=&quot;js&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; OpenAI &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;openai&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; client&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; OpenAI&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	apiKey: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;YOUR_PROVIDER_API_KEY&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;nb-shiki-21nrsd&quot;&gt;// Provider API key&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	baseURL:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;		&quot;https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; await&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; client.chat.completions.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	model: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;google-ai-studio/gemini-2.0-flash&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	messages: [{ role: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, content: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; }],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;console.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(response.choices[&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;].message.content);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Additionally, the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/chat-completion/&quot;&gt;OpenAI Compatible endpoint&lt;/a&gt; can be combined with our &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/universal/&quot;&gt;Universal Endpoint&lt;/a&gt; to add fallbacks across multiple providers. That means AI Gateway will return every response in the same standardized format, no extra parsing logic required!&lt;/p&gt;
&lt;p&gt;Learn more in the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/chat-completion/&quot;&gt;OpenAI Compatibility&lt;/a&gt; documentation.&lt;/p&gt;</description><pubDate>Tue, 03 Jun 2025 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - AI Gateway launches Realtime WebSockets API</title><link>https://developers.cloudflare.com/changelog/post/2025-03-20-websockets/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-03-20-websockets/</guid><description>&lt;p&gt;We are excited to announce that &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/&quot;&gt;AI Gateway&lt;/a&gt; now supports real-time AI interactions with the new &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/websockets-api/realtime-api/&quot;&gt;Realtime WebSockets API&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This new capability allows developers to establish persistent, low-latency connections between their applications and AI models, enabling natural, real-time conversational AI experiences, including speech-to-speech interactions.&lt;/p&gt;
&lt;p&gt;The Realtime WebSockets API works with the &lt;a href=&quot;https://platform.openai.com/docs/guides/realtime#connect-with-websockets&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;OpenAI Realtime API&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;, &lt;a href=&quot;https://ai.google.dev/gemini-api/docs/multimodal-live&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Google Gemini Live API&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;, and supports real-time text and speech interactions with models from &lt;a href=&quot;https://docs.cartesia.ai/api-reference/tts/tts&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Cartesia&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;, and &lt;a href=&quot;https://elevenlabs.io/docs/conversational-ai/api-reference/conversational-ai/websocket&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;ElevenLabs&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here&apos;s how you can connect AI Gateway to &lt;a href=&quot;https://platform.openai.com/docs/guides/realtime#connect-with-websockets&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;OpenAI&apos;s Realtime API&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt; using WebSockets:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure nb-code-figure-titled&quot; data-nb-lang=&quot;javascript&quot;&gt;&lt;figcaption class=&quot;nb-code-title&quot; data-pagefind-ignore=&quot;&quot;&gt;&lt;span class=&quot;nb-code-title-name&quot;&gt;OpenAI Realtime API example&lt;/span&gt;&lt;span class=&quot;nb-code-title-lang&quot;&gt;javascript&lt;/span&gt;&lt;/figcaption&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;javascript&quot; data-nb-lang=&quot;javascript&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; WebSocket &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &quot;ws&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;	&quot;wss://gateway.ai.cloudflare.com/v1/&amp;lt;account_id&amp;gt;/&amp;lt;gateway&amp;gt;/openai?model=gpt-4o-realtime-preview-2024-12-17&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; ws&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; new&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; WebSocket&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(url, {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	headers: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;		&quot;cf-aig-authorization&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: process.env.&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;CLOUDFLARE_API_KEY&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		Authorization: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;Bearer &quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt; +&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; process.env.&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;		&quot;OpenAI-Beta&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;realtime=v1&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;ws.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;open&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, () &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; console.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;Connected to server.&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;ws.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;, (&lt;/span&gt;&lt;span class=&quot;nb-shiki-1jdh33&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;nb-shiki-1itgoe&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; console.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(message.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;())));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;ws.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt;	JSON&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		type: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;response.create&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;		response: { modalities: [&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;text&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;], instructions: &lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;&quot;Tell me a joke&quot;&lt;/span&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;	}),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-140thh&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Get started by checking out the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/websockets-api/realtime-api/&quot;&gt;Realtime WebSockets API&lt;/a&gt; documentation.&lt;/p&gt;</description><pubDate>Fri, 21 Mar 2025 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Introducing Guardrails in AI Gateway</title><link>https://developers.cloudflare.com/changelog/post/2025-02-26-guardrails/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-02-26-guardrails/</guid><description>&lt;p&gt;&lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/&quot;&gt;AI Gateway&lt;/a&gt; now includes &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/guardrails/&quot;&gt;Guardrails&lt;/a&gt;, to help you monitor your AI apps for harmful or inappropriate content and deploy safely.&lt;/p&gt;
&lt;p&gt;Within the AI Gateway settings, you can configure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Guardrails&lt;/strong&gt;: Enable or disable content moderation as needed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Evaluation scope&lt;/strong&gt;: Select whether to moderate user prompts, model responses, or both.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hazard categories&lt;/strong&gt;: Specify which categories to monitor and determine whether detected inappropriate content should be blocked or flagged.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=2524,height=444,format=webp/_astro/Guardrails.BTNc0qeC.png&quot; alt=&quot;Guardrails in AI Gateway&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2524&quot; height=&quot;444&quot;&gt;
&lt;p&gt;Learn more in the &lt;a href=&quot;https://blog.cloudflare.com/guardrails-in-ai-gateway/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;blog&lt;span class=&quot;external-link&quot;&gt; ↗︎&lt;/span&gt;&lt;/a&gt; or our &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/features/guardrails/&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 26 Feb 2025 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - Request timeouts and retries with AI Gateway</title><link>https://developers.cloudflare.com/changelog/post/2025-02-05-aig-request-handling/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-02-05-aig-request-handling/</guid><description>&lt;p&gt;AI Gateway adds additional ways to handle requests - &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/request-handling/#request-timeouts&quot;&gt;Request Timeouts&lt;/a&gt; and &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/request-handling/#request-retries&quot;&gt;Request Retries&lt;/a&gt;, making it easier to keep your applications responsive and reliable.&lt;/p&gt;
&lt;p&gt;Timeouts and retries can be used on both the &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/universal/&quot;&gt;Universal Endpoint&lt;/a&gt; or directly to a &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/&quot;&gt;supported provider&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Request timeouts&lt;/strong&gt;
A &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/request-handling/#request-timeouts&quot;&gt;request timeout&lt;/a&gt; allows you to trigger &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/fallbacks/&quot;&gt;fallbacks&lt;/a&gt; or a retry if a provider takes too long to respond.&lt;/p&gt;
&lt;p&gt;To set a request timeout directly to a provider, add a &lt;code&gt;cf-aig-request-timeout&lt;/code&gt; header.&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure nb-code-figure-titled&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;figcaption class=&quot;nb-code-title&quot; data-pagefind-ignore=&quot;&quot;&gt;&lt;span class=&quot;nb-code-title-name&quot;&gt;Provider-specific endpoint example&lt;/span&gt;&lt;span class=&quot;nb-code-title-lang&quot;&gt;bash&lt;/span&gt;&lt;/figcaption&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/workers-ai/@cf/meta/llama-3.1-8b-instruct&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;Authorization: Bearer {cf_api_token}&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;Content-Type: application/json&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line highlighted&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;cf-aig-request-timeout: 5000&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt; --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&quot;prompt&quot;: &quot;What is Cloudflare?&quot;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Request retries&lt;/strong&gt;
A &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/configuration/request-handling/#request-retries&quot;&gt;request retry&lt;/a&gt; automatically retries failed requests, so you can recover from temporary issues without intervening.&lt;/p&gt;
&lt;p&gt;To set up request retries directly to a provider, add the following headers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;cf-aig-max-attempts (number)&lt;/li&gt;
&lt;li&gt;cf-aig-retry-delay (number)&lt;/li&gt;
&lt;li&gt;cf-aig-backoff (&quot;constant&quot; | &quot;linear&quot; | &quot;exponential)&lt;/li&gt;
&lt;/ul&gt;</description><pubDate>Thu, 06 Feb 2025 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - AI Gateway adds Cerebras, ElevenLabs, and Cartesia as new providers</title><link>https://developers.cloudflare.com/changelog/post/2025-02-04-aig-provider-cartesia-eleven-cerebras/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-02-04-aig-provider-cartesia-eleven-cerebras/</guid><description>&lt;p&gt;&lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/&quot;&gt;AI Gateway&lt;/a&gt; has added three new providers: &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/cartesia/&quot;&gt;Cartesia&lt;/a&gt;, &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/cerebras/&quot;&gt;Cerebras&lt;/a&gt;, and &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/elevenlabs/&quot;&gt;ElevenLabs&lt;/a&gt;, giving you more even more options for providers you can use through AI Gateway. Here&apos;s a brief overview of each:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/cartesia/&quot;&gt;Cartesia&lt;/a&gt; provides text-to-speech models that produce natural-sounding speech with low latency.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/cerebras/&quot;&gt;Cerebras&lt;/a&gt; delivers low-latency AI inference to Meta&apos;s Llama 3.1 8B and Llama 3.3 70B models.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/elevenlabs/&quot;&gt;ElevenLabs&lt;/a&gt; offers text-to-speech models with human-like voices in 32 languages.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=2278,height=1020,format=webp/_astro/cerebras2.qHYP0ZnF.png&quot; alt=&quot;Example of Cerebras log in AI Gateway&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;2278&quot; height=&quot;1020&quot;&gt;
&lt;p&gt;To get started with AI Gateway, just update the base URL. Here&apos;s how you can send a request to &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/cerebras/&quot;&gt;Cerebras&lt;/a&gt; using cURL:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure nb-code-figure-titled&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;figcaption class=&quot;nb-code-title&quot; data-pagefind-ignore=&quot;&quot;&gt;&lt;span class=&quot;nb-code-title-name&quot;&gt;Example fetch request&lt;/span&gt;&lt;span class=&quot;nb-code-title-lang&quot;&gt;bash&lt;/span&gt;&lt;/figcaption&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; -X&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; POST&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/cerebras/chat/completions&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;content-type: application/json&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;Authorization: Bearer CEREBRAS_TOKEN&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;model&quot;: &quot;llama-3.3-70b&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;messages&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;            &quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;            &quot;content&quot;: &quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</description><pubDate>Wed, 05 Feb 2025 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - AI Gateway Introduces New Worker Binding Methods</title><link>https://developers.cloudflare.com/changelog/post/2025-01-26-worker-binding-methods/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-01-26-worker-binding-methods/</guid><description>&lt;p&gt;We have released new &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/&quot;&gt;Workers bindings API methods&lt;/a&gt;, allowing you to connect Workers applications to AI Gateway directly. These methods simplify how Workers calls AI services behind your AI Gateway configurations, removing the need to use the REST API and manually authenticate.&lt;/p&gt;
&lt;p&gt;To add an AI binding to your Worker, include the following in your &lt;a href=&quot;https://developers.cloudflare.com/workers/wrangler/configuration/&quot;&gt;Wrangler configuration file&lt;/a&gt;:&lt;/p&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=754,height=135,format=webp/_astro/add-binding.BoYTiyon.png&quot; alt=&quot;Add an AI binding to your Worker.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;754&quot; height=&quot;135&quot;&gt;
&lt;p&gt;With the new AI Gateway binding methods, you can now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Send feedback and update metadata with &lt;code&gt;patchLog&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Retrieve detailed log information using &lt;code&gt;getLog&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Execute &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/universal/&quot;&gt;universal requests&lt;/a&gt; to any AI Gateway provider with &lt;code&gt;run&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, to send feedback and update metadata using &lt;code&gt;patchLog&lt;/code&gt;:&lt;/p&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=736,height=235,format=webp/_astro/send-feedback.BGRzKmd9.png&quot; alt=&quot;Send feedback and update metadata using patchLog:&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;736&quot; height=&quot;235&quot;&gt;</description><pubDate>Thu, 30 Jan 2025 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item><item><title>AI Gateway - AI Gateway adds DeepSeek as a Provider</title><link>https://developers.cloudflare.com/changelog/post/2025-01-07-aig-provider-deepseek/</link><guid isPermaLink="true">https://developers.cloudflare.com/changelog/post/2025-01-07-aig-provider-deepseek/</guid><description>&lt;p&gt;&lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/&quot;&gt;&lt;strong&gt;AI Gateway&lt;/strong&gt;&lt;/a&gt; now supports &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/deepseek/&quot;&gt;&lt;strong&gt;DeepSeek&lt;/strong&gt;&lt;/a&gt;, including their cutting-edge DeepSeek-V3 model. With this addition, you have even more flexibility to manage and optimize your AI workloads using AI Gateway. Whether you&apos;re leveraging DeepSeek or other providers, like OpenAI, Anthropic, or &lt;a href=&quot;https://developers.cloudflare.com/workers-ai/&quot;&gt;Workers AI&lt;/a&gt;, AI Gateway empowers you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Monitor&lt;/strong&gt;: Gain actionable insights with analytics and logs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Control&lt;/strong&gt;: Implement caching, rate limiting, and fallbacks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optimize&lt;/strong&gt;: Improve performance with feedback and evaluations.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://developers.cloudflare.com/cdn-cgi/image/onerror=redirect,width=1600,height=131,format=webp/_astro/deepseek.hirkr3rv.png&quot; alt=&quot;AI Gateway adds DeepSeek as a provider&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1600&quot; height=&quot;131&quot;&gt;
&lt;p&gt;To get started, simply update the base URL of your DeepSeek API calls to route through AI Gateway. Here&apos;s how you can send a request using cURL:&lt;/p&gt;
&lt;figure class=&quot;nb-code-figure nb-code-figure-titled&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;figcaption class=&quot;nb-code-title&quot; data-pagefind-ignore=&quot;&quot;&gt;&lt;span class=&quot;nb-code-title-name&quot;&gt;Example fetch request&lt;/span&gt;&lt;span class=&quot;nb-code-title-lang&quot;&gt;bash&lt;/span&gt;&lt;/figcaption&gt;&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot; data-nb-lang=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-1t8gfj&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/chat/completions&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;content-type: application/json&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --header&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;Authorization: Bearer DEEPSEEK_TOKEN&apos;&lt;/span&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-dzsirb&quot;&gt; --data&lt;/span&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt; &apos;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;model&quot;: &quot;deepseek-chat&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    &quot;messages&quot;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;            &quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;            &quot;content&quot;: &quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb-shiki-mdbnqw&quot;&gt;}&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;For detailed setup instructions, see our &lt;a href=&quot;https://developers.cloudflare.com/ai-gateway/usage/providers/deepseek/&quot;&gt;DeepSeek provider documentation&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Thu, 02 Jan 2025 00:00:00 GMT</pubDate><product>AI Gateway</product><category>AI Gateway</category></item></channel></rss>