OpenAICloudflare Developer PlatformMar 2, 2026, 12:00 AM

AI Gateway - Get started with AI Gateway automatically

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

AI Gateway - Get started with AI Gateway automatically

Key Points

  • Single API call auto-creates gateway
  • Use gateway ID 'default' with no setup
  • Requires AI Gateway Read/Edit and Workers AI Read

Summary

You can start using Cloudflare AI Gateway with a single API call — no pre-provisioning required. Use the gateway ID default and the gateway will be created automatically on the first request. The endpoint provides unified access to multiple AI providers and adds Cloudflare features like logging, caching, and rate limiting.

Key Points

Quick start

Replace $CLOUDFLARE_ACCOUNT_ID and $CLOUDFLARE_API_TOKEN, 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?" }]
  }'

Notes

  • Ensure the API token includes the three permissions listed above.
  • Use the default ID to avoid manual gateway setup. For customization and more details, see the Cloudflare AI Gateway documentation (Get started).

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

AI Gateway - AI Gateway を自動で開始する

AI Gateway を自動で開始する

公開日: 2026-03-02 · AI Gateway

単一のAPIコールでAI Gatewayを使用開始できます — 事前のセットアップは不要です。ゲートウェイIDに default を使用すると、最初のリクエスト時にAI Gatewayが自動で作成します。

使い方

  1. 次の権限を持つAPIトークンを作成します:
  • AI Gateway - Read
  • AI Gateway - Edit
  • Workers AI - Read
  1. 次のコマンドを実行して試します:

    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は単一のエンドポイントを通じて、ロギング、キャッシュ、レート制限、および複数のAIプロバイダへのアクセスを提供します。

詳細は Get started を参照してください。

AI Gateway - Get started with AI Gateway automatically | Cloudflare Developer Platform | DocsDigest