始める
Last reviewed: 3 months ago
このガイドでは、最初のAIゲートウェイを作成する方法を学びます。異なるアプリケーションを制御するために、複数のゲートウェイを作成できます。
始める前に、Cloudflareアカウントが必要です。
サインアップ
次に、新しいAIゲートウェイを作成します。
To set up an AI Gateway in the dashboard:
- Log into the Cloudflare dashboard ↗ and select your account.
- Go to AI > AI Gateway.
- Select Create Gateway.
- Enter your Gateway name. Note: Gateway name has a 64 character limit.
- Select Create.
To set up an AI Gateway using the API:
-
Create an API token with the following permissions:
AI Gateway - ReadAI Gateway - Edit
-
Get your Account ID.
-
Using that API token and Account ID, send a
POSTrequest to the Cloudflare API.
次に、AIプロバイダーをゲートウェイに接続します。
AIゲートウェイは、作成した各ゲートウェイに対して複数のエンドポイントを提供します - プロバイダーごとに1つのエンドポイントと1つのユニバーサルエンドポイントがあります。
サポートされているプロバイダー
プロバイダーの好みがない場合は、専用のチュートリアルの1つから始めてください。
プロバイダーがAIゲートウェイに接続されたので、ゲートウェイを通過するリクエストの分析を表示できます。
Your AI Gateway dashboard shows metrics on requests, tokens, caching, errors, and cost. You can filter these metrics by time and provider-type.
To view analytics in the dashboard:
- Log into the Cloudflare dashboard ↗ and select your account.
- Go to AI > AI Gateway.
- Make sure you have your gateway selected.
- より速いリクエストとコスト削減のためのキャッシングや、アプリケーションのスケールを制御するためのレート制限について学びましょう。
- レジリエンシーのためにモデルやプロバイダーのフォールバックを指定する方法を探ります。
- 低コストのオープンソースモデルをWorkers AIで使用する方法を学びましょう - これは私たちのAI推論サービスです。