<?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 - 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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/auto-retry-changelog.DoCXZnDy_bIipL.webp&quot; alt=&quot;Retry Requests settings in the AI Gateway dashboard&quot;&gt;&lt;/starlight-image-zoom-zoomable&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/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;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;https://gateway.ai.cloudflare.com/v1/&lt;/span&gt;&lt;span&gt;$ACCOUNT_ID&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;&lt;span&gt;$GATEWAY_ID&lt;/span&gt;&lt;span&gt;/openai/chat/completions&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;Authorization: Bearer &lt;/span&gt;&lt;span&gt;$TOKEN&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;Content-Type: application/json&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;cf-aig-collect-log-payload: false&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;--data&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;model&quot;: &quot;gpt-4o-mini&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;messages&quot;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;content&quot;: &quot;What is the email address and phone number of user123?&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;-X&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;POST&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;https://gateway.ai.cloudflare.com/v1/&lt;/span&gt;&lt;span&gt;$CLOUDFLARE_ACCOUNT_ID&lt;/span&gt;&lt;span&gt;/default/compat/chat/completions&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;cf-aig-authorization: Bearer &lt;/span&gt;&lt;span&gt;$CLOUDFLARE_API_TOKEN&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;Content-Type: application/json&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;--data&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;model&quot;: &quot;workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;messages&quot;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;content&quot;: &quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/sidebar-navigation.BQNFBmAk_1GqV9H.webp&quot; alt=&quot;AI sidebar navigation in the Cloudflare dashboard&quot;&gt;&lt;/starlight-image-zoom-zoomable&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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/onboarding-flow.DZ7aMcHa_Z2hyg1I.webp&quot; alt=&quot;AI Gateway onboarding flow&quot;&gt;&lt;/starlight-image-zoom-zoomable&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/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;&gt;Bring Your Own Key&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;&gt;in the dashboard&lt;/a&gt; by navigating into your gateway -&gt; &lt;strong&gt;Provider Keys&lt;/strong&gt; -&gt; &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;
&lt;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/add-secret-ai-gateway.B-SIPr6s_jJjDD.webp&quot; alt=&quot;Import repo or choose template&quot;&gt;&lt;/starlight-image-zoom-zoomable&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;&gt;wrangler&lt;/a&gt;, the &lt;a href=&quot;http://dash.cloudflare.com/?to=/:account/secrets-store&quot; target=&quot;_blank&quot;&gt;Secrets Store dashboard&lt;/a&gt;, or the &lt;a href=&quot;https://developers.cloudflare.com/api/resources/secrets_store/&quot; target=&quot;_blank&quot;&gt;API&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;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code class=&quot;language-plaintext&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl -X POST https://gateway.ai.cloudflare.com/v1/&amp;#x3C;ACCOUNT_ID&gt;/my-gateway/anthropic/v1/messages \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;--header &apos;cf-aig-authorization: ANTHROPIC_KEY_1 \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;--header &apos;anthropic-version: 2023-06-01&apos; \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;--header &apos;Content-Type: application/json&apos; \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;--data  &apos;{&quot;model&quot;: &quot;claude-3-opus-20240229&quot;, &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;What is Cloudflare?&quot;}]}&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Or, using Javascript:&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code class=&quot;language-plaintext&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;import Anthropic from &apos;@anthropic-ai/sdk&apos;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const anthropic = new Anthropic({&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;apiKey: &quot;ANTHROPIC_KEY_1&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;baseURL: &quot;https://gateway.ai.cloudflare.com/v1/&amp;#x3C;ACCOUNT_ID&gt;/my-gateway/anthropic&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const message = await anthropic.messages.create({&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;model: &apos;claude-3-opus-20240229&apos;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;messages: [{role: &quot;user&quot;, content: &quot;What is Cloudflare?&quot;}],&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;max_tokens: 1024&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;});&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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;&gt;blog&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;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;js&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;OpenAI&lt;/span&gt;&lt;span&gt; from &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;openai&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;client&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;new&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;OpenAI&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;apiKey&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;YOUR_PROVIDER_API_KEY&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;// Provider API key&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;baseURL&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;&quot;https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;response&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;await&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;client&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;chat&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;completions&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;create&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;model&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;google-ai-studio/gemini-2.0-flash&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;messages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; [&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span&gt; role&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;user&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; content&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;console&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;response&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;choices&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;message&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;content&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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;&gt;OpenAI Realtime API&lt;/a&gt;, &lt;a href=&quot;https://ai.google.dev/gemini-api/docs/multimodal-live&quot; target=&quot;_blank&quot;&gt;Google Gemini Live API&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;&gt;Cartesia&lt;/a&gt;, and &lt;a href=&quot;https://elevenlabs.io/docs/conversational-ai/api-reference/conversational-ai/websocket&quot; target=&quot;_blank&quot;&gt;ElevenLabs&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;&gt;OpenAI&apos;s Realtime API&lt;/a&gt; using WebSockets:&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;WebSocket&lt;/span&gt;&lt;span&gt; from &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;ws&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;url&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;&quot;wss://gateway.ai.cloudflare.com/v1/&amp;#x3C;account_id&gt;/&amp;#x3C;gateway&gt;/openai?model=gpt-4o-realtime-preview-2024-12-17&quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;ws&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;new&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;WebSocket&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;url&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;headers&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;&quot;cf-aig-authorization&quot;&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;process&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;env&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;CLOUDFLARE_API_KEY&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;Authorization&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;Bearer &quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;+&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;process&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;env&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;&quot;OpenAI-Beta&quot;&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;realtime=v1&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;ws&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&quot;open&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;()&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;console&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&quot;Connected to server.&quot;&lt;/span&gt;&lt;span&gt;))&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;ws&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;on&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&quot;message&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;message&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;console&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;log&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;JSON&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;parse&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;message&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;toString&lt;/span&gt;&lt;span&gt;())))&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;ws&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;send&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span&gt;JSON&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;stringify&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;type&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;response.create&quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;response&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span&gt; modalities&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; [&lt;/span&gt;&lt;span&gt;&quot;text&quot;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; instructions&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&quot;Tell me a joke&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;},&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/Guardrails.BTNc0qeC_Z1HC20z.webp&quot; alt=&quot;Guardrails in AI Gateway&quot;&gt;&lt;/starlight-image-zoom-zoomable&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;&gt;blog&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;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&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&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;Authorization: Bearer {cf_api_token}&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;Content-Type: application/json&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;cf-aig-request-timeout: 5000&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--data&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;{&quot;prompt&quot;: &quot;What is Cloudflare?&quot;}&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/cerebras2.qHYP0ZnF_XMtnx.webp&quot; alt=&quot;Example of Cerebras log in AI Gateway&quot;&gt;&lt;/starlight-image-zoom-zoomable&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;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;-X&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;POST&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/cerebras/chat/completions&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;content-type: application/json&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;Authorization: Bearer CEREBRAS_TOKEN&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--data&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;model&quot;: &quot;llama-3.3-70b&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;messages&quot;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;content&quot;: &quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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/integrations/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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/add-binding.BoYTiyon_ZjdDNx.webp&quot; alt=&quot;Add an AI binding to your Worker.&quot;&gt;&lt;/starlight-image-zoom-zoomable&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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/send-feedback.BGRzKmd9_NDVos.webp&quot; alt=&quot;Send feedback and update metadata using patchLog:&quot;&gt;&lt;/starlight-image-zoom-zoomable&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;starlight-image-zoom-zoomable&gt;&lt;img src=&quot;https://developers.cloudflare.com/_astro/deepseek.hirkr3rv_CgMEY.webp&quot; alt=&quot;AI Gateway adds DeepSeek as a provider&quot;&gt;&lt;/starlight-image-zoom-zoomable&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;div&gt;&lt;figure&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;curl&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/chat/completions&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;content-type: application/json&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--header&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;Authorization: Bearer DEEPSEEK_TOKEN&apos;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--data&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&apos;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;model&quot;: &quot;deepseek-chat&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;messages&quot;: [&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;role&quot;: &quot;user&quot;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&quot;content&quot;: &quot;What is Cloudflare?&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&apos;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&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>