Zum Inhalt springen

AI Gateway Updates & Release Notes

Einträge
33
Quellen
1
Zuletzt aktualisiert

Folge AI Gateway, um die Release Notes in deinen Feed zu holen.

AI Gateway von Cloudflare

AI Gateway: Neue REST API für beliebige KI-Modelle

AI Gateway nutzt jetzt die AI REST API auf api.cloudflare.com mit vier Endpunkten (/ai/run, /ai/v1/chat/completions, /ai/v1/responses, /ai/v1/messages), über die sich Modelle verschiedener Anbieter einheitlich aufrufen lassen, wobei Logging, Caching, Rate Limiting und Guardrails automatisch greifen und Drittanbieter-Modelle über Unified Billing abgerechnet werden.

AI Gateway now uses the AI REST API on api.cloudflare.com. 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:

  • POST /ai/run — universal endpoint for all models and modalities
  • POST /ai/v1/chat/completions — OpenAI SDK compatible
  • POST /ai/v1/responses — OpenAI Responses API compatible
  • POST /ai/v1/messages — Anthropic SDK compatible
curl -X POST "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions" \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "openai/gpt-5.5",
    "messages": [{"role": "user", "content": "What is Cloudflare?"}]
  }'

All AI Gateway features — logging, caching, rate limiting, and guardrails — are applied automatically. Third-party models are billed through Unified Billing, so you do not need to manage separate provider API keys.

Third-party model requests are routed through your account's default gateway, which is created automatically on first use. To route requests through a specific gateway, add the cf-aig-gateway-id header. …

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: Automatische Wiederholung bei Anbieterfehlern

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.

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.

Retry Requests settings in the AI Gateway dashboard

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 Dynamic Routing.

For more information, refer to Manage gateways.

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: Metadaten loggen ohne Payload-Speicherung

Der neue Header cf-aig-collect-log-payload steuert, ob Request- und Response-Bodies in Logs gespeichert werden; mit dem Wert false werden nur Metadaten wie Token-Anzahl, Modell, Anbieter, Statuscode, Kosten und Dauer protokolliert.

AI Gateway now supports the cf-aig-collect-log-payload header, which controls whether request and response bodies are stored in logs. By default, this header is set to true and payloads are stored alongside metadata. Set this header to false to skip payload storage while still logging metadata such as token counts, model, provider, status code, cost, and duration.

This is useful when you need usage metrics but do not want to persist sensitive prompt or response data.

curl https://gateway.ai.cloudflare.com/v1/$ACCOUNT_ID/$GATEWAY_ID/openai/chat/completions \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --header 'cf-aig-collect-log-payload: false' \
  --data '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "What is the email address and phone number of user123?"
      }
    ]
  }'

For more information, refer to Logging.

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: Einstieg ohne Einrichtung über Gateway-ID default

Mit default als Gateway-ID legt AI Gateway beim ersten Request automatisch ein Gateway an, sodass sich der Dienst mit einem einzigen API-Aufruf ohne Setup nutzen lässt.

You can now start using AI Gateway with a single API call — no setup required. Use default as your gateway ID, and AI Gateway creates one for you automatically on the first request.

To try it out, create an API token with AI Gateway - Read, AI Gateway - Edit, and Workers AI - Read permissions, then run:

curl -X POST https://gateway.ai.cloudflare.com/v1/$CLOUDFLARE_ACCOUNT_ID/default/compat/chat/completions \
  --header "cf-aig-authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "messages": [
      {
        "role": "user",
        "content": "What is Cloudflare?"
      }
    ]
  }'

AI Gateway gives you logging, caching, rate limiting, and access to multiple AI providers through a single endpoint. For more information, refer to Get started.

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway und Workers AI: Verbesserungen am Dashboard

Das Cloudflare-Dashboard erhält für Workers AI und AI Gateway einen eigenen Bereich AI in der Seitenleiste sowie ein vereinfachtes Onboarding mit OpenAI-kompatiblem Endpunkt, Schritt-für-Schritt-Hilfe, Playground-Vorschlägen und klareren nächsten Schritten auf den Nutzungsseiten.

Workers AI and AI Gateway have received a series of dashboard improvements to help you get started faster and manage your AI workloads more easily.

Navigation and discoverability

AI now has its own top-level section in the Cloudflare dashboard sidebar, so you can find AI features without digging through menus.

AI sidebar navigation in the Cloudflare dashboard The new top-level AI section in the dashboard sidebar.

Onboarding and getting started

Getting started with AI Gateway is now simpler. When you create your first gateway, we now show your gateway'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.

AI Gateway onboarding flow The first-run setup experience for new gateways. …

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: BYOK jetzt mit Cloudflare Secrets Store

AI Gateway ist mit dem Cloudflare Secrets Store integriert, sodass sich KI-Anbieter-Schlüssel per BYOK zentral verwalten und im Request nur über eine Referenz statt im Klartext übergeben lassen, wobei Secrets mit dem neuen Scope ai_gateway im Dashboard, per wrangler oder API angelegt werden können.

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 Bring Your Own Key ↗︎. 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.

You can now create a secret directly from your AI Gateway in the dashboard ↗︎ by navigating into your gateway -> Provider Keys -> Add.

Import repo or choose template

You can also create your secret with the newly available ai_gateway scope via wrangler ↗︎, the Secrets Store dashboard ↗︎, or the API ↗︎.

Then, pass the key in the request header using its Secrets Store reference:

curl -X POST https://gateway.ai.cloudflare.com/v1/<ACCOUNT_ID>/my-gateway/anthropic/v1/messages \
 --header 'cf-aig-authorization: ANTHROPIC_KEY_1 \
 --header 'anthropic-version: 2023-06-01' \ …

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: OpenAI-kompatibler Endpunkt

AI Gateway bietet jetzt einen OpenAI-kompatiblen Chat-Completions-Endpunkt, mit dem sich bei gleichem Request- und Response-Format zwischen Anbietern wechseln und per Universal Endpoint Fallbacks einrichten lassen, wobei der Embeddings-Endpunkt als Nächstes folgt.

Users can now use an OpenAI Compatible endpoint in AI Gateway to easily switch between providers, while keeping the exact same request and response formats. We're launching now with the chat completions endpoint, with the embeddings endpoint coming up next.

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 model and apiKey parameters.

OpenAI SDK Examplejs

import OpenAI from "openai";
const client = new OpenAI({
	apiKey: "YOUR_PROVIDER_API_KEY", // Provider API key
	baseURL:
		"https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat",
});

const response = await client.chat.completions.create({
	model: "google-ai-studio/gemini-2.0-flash",
	messages: [{ role: "user", content: "What is Cloudflare?" }],
});

console.log(response.choices[0].message.content);

Additionally, the OpenAI Compatible endpoint can be combined with our Universal Endpoint to add fallbacks across multiple providers. That means AI Gateway will return every response in the same standardized format, no extra parsing logic required!

Learn more in the OpenAI Compatibility documentation.

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: Realtime WebSockets API gestartet

AI Gateway unterstützt jetzt mit der Realtime WebSockets API persistente Verbindungen mit niedriger Latenz für Echtzeit-KI-Interaktionen inklusive Speech-to-Speech, kompatibel mit OpenAI Realtime API, Google Gemini Live API sowie Cartesia und ElevenLabs.

We are excited to announce that AI Gateway now supports real-time AI interactions with the new Realtime WebSockets API.

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.

The Realtime WebSockets API works with the OpenAI Realtime API ↗︎, Google Gemini Live API ↗︎, and supports real-time text and speech interactions with models from Cartesia ↗︎, and ElevenLabs ↗︎.

Here's how you can connect AI Gateway to OpenAI's Realtime API ↗︎ using WebSockets:

OpenAI Realtime API examplejavascript

import WebSocket from "ws";

const url =
	"wss://gateway.ai.cloudflare.com/v1/<account_id>/<gateway>/openai?model=gpt-4o-realtime-preview-2024-12-17";
const ws = new WebSocket(url, {
	headers: {
		"cf-aig-authorization": process.env.CLOUDFLARE_API_KEY,
		Authorization: "Bearer " + process.env.OPENAI_API_KEY,
		"OpenAI-Beta": "realtime=v1", …

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: Guardrails zur Inhaltsmoderation

AI Gateway enthält jetzt Guardrails, mit denen sich Inhaltsmoderation aktivieren, der Prüfumfang (Prompts, Antworten oder beides) festlegen und Gefahrenkategorien samt Blockieren oder Markieren erkannter Inhalte konfigurieren lassen.

AI Gateway now includes Guardrails, to help you monitor your AI apps for harmful or inappropriate content and deploy safely.

Within the AI Gateway settings, you can configure:

  • Guardrails: Enable or disable content moderation as needed.
  • Evaluation scope: Select whether to moderate user prompts, model responses, or both.
  • Hazard categories: Specify which categories to monitor and determine whether detected inappropriate content should be blocked or flagged.

Guardrails in AI Gateway

Learn more in the blog ↗︎ or our documentation.

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: Request Timeouts und Retries

AI Gateway unterstützt jetzt Request Timeouts (per Header cf-aig-request-timeout) und Request Retries, mit denen bei langsamen Providern Fallbacks oder Wiederholungen ausgelöst werden können, sowohl am Universal Endpoint als auch direkt bei unterstützten Providern.

AI Gateway adds additional ways to handle requests - Request Timeouts and Request Retries, making it easier to keep your applications responsive and reliable.

Timeouts and retries can be used on both the Universal Endpoint or directly to a supported provider.

Request timeouts A request timeout allows you to trigger fallbacks or a retry if a provider takes too long to respond.

To set a request timeout directly to a provider, add a cf-aig-request-timeout header.

Provider-specific endpoint examplebash

curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/workers-ai/@cf/meta/llama-3.1-8b-instruct \
 --header 'Authorization: Bearer {cf_api_token}' \
 --header 'Content-Type: application/json' \
 --header 'cf-aig-request-timeout: 5000'
 --data '{"prompt": "What is Cloudflare?"}'
``` …

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway ergänzt Cerebras, ElevenLabs und Cartesia

AI Gateway unterstützt nun drei neue Provider: Cartesia und ElevenLabs für Text-to-Speech sowie Cerebras für Inferenz mit Llama 3.1 8B und Llama 3.3 70B.

AI Gateway has added three new providers: Cartesia, Cerebras, and ElevenLabs, giving you more even more options for providers you can use through AI Gateway. Here's a brief overview of each:

  • Cartesia provides text-to-speech models that produce natural-sounding speech with low latency.
  • Cerebras delivers low-latency AI inference to Meta's Llama 3.1 8B and Llama 3.3 70B models.
  • ElevenLabs offers text-to-speech models with human-like voices in 32 languages.

Example of Cerebras log in AI Gateway

To get started with AI Gateway, just update the base URL. Here's how you can send a request to Cerebras using cURL:

Example fetch requestbash

curl -X POST https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/cerebras/chat/completions \ …

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway: Neue Worker-Binding-Methoden

Neue Workers-Binding-API-Methoden verbinden Workers direkt mit AI Gateway, sodass Nutzer ohne REST API und manuelle Authentifizierung mit patchLog Feedback und Metadaten aktualisieren, mit getLog Logs abrufen und mit run Universal Requests ausführen können.

We have released new Workers bindings API methods, 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.

To add an AI binding to your Worker, include the following in your Wrangler configuration file:

Add an AI binding to your Worker.

With the new AI Gateway binding methods, you can now:

  • Send feedback and update metadata with patchLog.
  • Retrieve detailed log information using getLog.
  • Execute universal requests to any AI Gateway provider with run.

For example, to send feedback and update metadata using patchLog:

Send feedback and update metadata using patchLog:

Originalquelle(öffnet in neuem Tab)Problem melden

AI Gateway von Cloudflare

AI Gateway unterstützt DeepSeek als Provider

AI Gateway unterstützt nun DeepSeek einschließlich des Modells DeepSeek-V3, indem die Base-URL der DeepSeek-API-Aufrufe auf AI Gateway umgestellt wird.

AI Gateway now supports DeepSeek, 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're leveraging DeepSeek or other providers, like OpenAI, Anthropic, or Workers AI, AI Gateway empowers you to:

  • Monitor: Gain actionable insights with analytics and logs.
  • Control: Implement caching, rate limiting, and fallbacks.
  • Optimize: Improve performance with feedback and evaluations.

AI Gateway adds DeepSeek as a provider

To get started, simply update the base URL of your DeepSeek API calls to route through AI Gateway. Here's how you can send a request using cURL:

Example fetch requestbash

curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/chat/completions \
 --header 'content-type: application/json' \
 --header 'Authorization: Bearer DEEPSEEK_TOKEN' \
 --data '{
    "model": "deepseek-chat",
    "messages": [
        {
            "role": "user",
            "content": "What is Cloudflare?"
        }
    ]
}'
``` …

Originalquelle(öffnet in neuem Tab)Problem melden