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 modalitiesPOST /ai/v1/chat/completions— OpenAI SDK compatiblePOST /ai/v1/responses— OpenAI Responses API compatiblePOST /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. …