# AI Gateway AI アプリケーションを観測し制御します > 以下のリンクは、各ページの Markdown 版を直接指します。 任意のページは、`index.md` サフィックスなしの URL に `Accept: text/markdown` ヘッダーを付けて取得することもできます(例: `curl -H "Accept: text/markdown" https://developers.cloudflare.com/ai-gateway/`)。 > > その他の Cloudflare 製品は、[Cloudflare ドキュメントディレクトリ](https://developers.cloudflare.com/llms.txt) を参照してください。 ## 概要 - [Cloudflare AI Gateway](https://developers.cloudflare.com/ai-gateway/index.md): AI Gateway で、分析、キャッシュ、レート制限、モデルフォールバックを使い、AI アプリケーションを観測・制御します。 ## はじめに - [はじめに](https://developers.cloudflare.com/ai-gateway/get-started/index.md): AI Gateway を設定し、最初のリクエストを送信して、AI API トラフィックを観測・制御します。 ## モデル - [モデル](https://developers.cloudflare.com/ai/models/index.md): AI Gateway で使える AI モデルを確認します。OpenAI、Anthropic、Google のモデルを含みます。 ## AI Gateway の使い方 - [AI Gateway の使い方](https://developers.cloudflare.com/ai-gateway/usage/index.md): 統合 API、プロバイダー固有のエンドポイント、または WebSockets で、AI アプリケーションを AI Gateway に接続します。 - [Unified API(OpenAI 互換)](https://developers.cloudflare.com/ai-gateway/usage/chat-completion/index.md): AI Gateway の OpenAI 互換エンドポイント 1 つから、複数の AI プロバイダーへリクエストを送ります。 - [Anthropic](https://developers.cloudflare.com/ai-gateway/usage/providers/anthropic/index.md): Anthropic API リクエストを AI Gateway 経由でルーティングし、可観測性と制御を得ます。 - [Azure OpenAI](https://developers.cloudflare.com/ai-gateway/usage/providers/azureopenai/index.md): 観測と制御のため、Azure OpenAI のリクエストを AI Gateway 経由でルーティングします。 - [Baseten](https://developers.cloudflare.com/ai-gateway/usage/providers/baseten/index.md): 観測と制御のため、Baseten のモデル推論リクエストを AI Gateway 経由でルーティングします。 - [Amazon Bedrock](https://developers.cloudflare.com/ai-gateway/usage/providers/bedrock/index.md): オブザーバビリティと制御のため、Amazon Bedrock のリクエストを AI Gateway 経由でルーティングします。 - [Cartesia](https://developers.cloudflare.com/ai-gateway/usage/providers/cartesia/index.md): Cartesia のテキスト読み上げリクエストを AI Gateway 経由でルーティングし、可観測性と制御を得られます。 - [Cerebras](https://developers.cloudflare.com/ai-gateway/usage/providers/cerebras/index.md): Cerebras の推論リクエストを AI Gateway 経由でルーティングし、可観測性と制御を得ます。 - [Cohere](https://developers.cloudflare.com/ai-gateway/usage/providers/cohere/index.md): Cohere API のリクエストを AI Gateway 経由でルーティングし、オブザーバビリティと制御を使います。 - [Deepgram](https://developers.cloudflare.com/ai-gateway/usage/providers/deepgram/index.md): オブザーバビリティと制御のため、Deepgram の音声認識およびテキスト読み上げリクエストを AI Gateway 経由でルーティングします。 - [DeepSeek](https://developers.cloudflare.com/ai-gateway/usage/providers/deepseek/index.md): DeepSeek API リクエストを AI Gateway 経由でルーティングし、可観測性と制御を得ます。 - [ElevenLabs](https://developers.cloudflare.com/ai-gateway/usage/providers/elevenlabs/index.md): 観測と制御のため、ElevenLabs のテキスト読み上げリクエストを AI Gateway 経由でルーティングします。 - [Fal AI](https://developers.cloudflare.com/ai-gateway/usage/providers/fal/index.md): 観測と制御のため、Fal AI の生成メディアリクエストを AI Gateway 経由でルーティングします。 - [Google AI Studio](https://developers.cloudflare.com/ai-gateway/usage/providers/google-ai-studio/index.md): オブザーバビリティと制御のため、Google AI Studio と Gemini のリクエストを AI Gateway 経由でルーティングします。 - [xAI](https://developers.cloudflare.com/ai-gateway/usage/providers/grok/index.md): xAI(Grok)の API リクエストを AI Gateway 経由でルーティングし、可観測性と制御を得られます。 - [Groq](https://developers.cloudflare.com/ai-gateway/usage/providers/groq/index.md): Groq API リクエストを AI Gateway 経由でルーティングし、可観測性と制御を得ます。 - [HuggingFace](https://developers.cloudflare.com/ai-gateway/usage/providers/huggingface/index.md): HuggingFace Inference API のリクエストを AI Gateway 経由でルーティングし、オブザーバビリティと制御を使います。 - [Ideogram](https://developers.cloudflare.com/ai-gateway/usage/providers/ideogram/index.md): オブザーバビリティと制御のため、Ideogram の画像生成リクエストを AI Gateway 経由でルーティングします。 - [Mistral AI](https://developers.cloudflare.com/ai-gateway/usage/providers/mistral/index.md): 観測と制御のため、Mistral AI のリクエストを AI Gateway 経由でルーティングします。 - [OpenAI](https://developers.cloudflare.com/ai-gateway/usage/providers/openai/index.md): 観測と制御のため、OpenAI API リクエストを AI Gateway 経由でルーティングします。 - [OpenRouter](https://developers.cloudflare.com/ai-gateway/usage/providers/openrouter/index.md): オブザーバビリティと制御のため、OpenRouter API のリクエストを AI Gateway 経由でルーティングします。 - [Parallel](https://developers.cloudflare.com/ai-gateway/usage/providers/parallel/index.md): Parallel の API リクエストを AI Gateway 経由でルーティングし、可観測性と制御を得られます。 - [Perplexity](https://developers.cloudflare.com/ai-gateway/usage/providers/perplexity/index.md): Perplexity API リクエストを AI Gateway 経由でルーティングし、可観測性と制御を得ます。 - [Replicate](https://developers.cloudflare.com/ai-gateway/usage/providers/replicate/index.md): Replicate API のリクエストを AI Gateway 経由でルーティングし、オブザーバビリティと制御を使います。 - [Google Vertex AI](https://developers.cloudflare.com/ai-gateway/usage/providers/vertex/index.md): オブザーバビリティと制御のため、Google Vertex AI のリクエストを AI Gateway 経由でルーティングします。 - [Workers AI](https://developers.cloudflare.com/ai-gateway/usage/providers/workersai/index.md): 分析、キャッシュ、レート制限のために、Workers AI のリクエストを AI Gateway 経由でルーティングします。 - [REST API](https://developers.cloudflare.com/ai-gateway/usage/rest-api/index.md): Cloudflare API 経由で第三者モデルと Workers AI モデルを呼び出し、ログ、キャッシュ、レート制限などの AI Gateway 機能を使います。 - [Universal Endpoint(非推奨)](https://developers.cloudflare.com/ai-gateway/usage/universal/index.md): フォールバックとリトライに対応した単一の AI Gateway エンドポイント経由で、任意の AI プロバイダーへリクエストをルーティングします。 - [Web Search](https://developers.cloudflare.com/ai-gateway/usage/web-search/index.md): AI Gateway 経由でプロバイダーネイティブの Web 検索ツールを使うか、Perplexity や Parallel などの検索特化プロバイダーへプロキシエンドポイントで接続します。 - [WebSockets API](https://developers.cloudflare.com/ai-gateway/usage/websockets-api/index.md): AI Gateway 経由の持続的な WebSocket 接続で、リアルタイムおよび非リアルタイムの AI 対話を行えます。 - [非リアルタイム WebSockets API](https://developers.cloudflare.com/ai-gateway/usage/websockets-api/non-realtime-api/index.md): リアルタイムストリーミングなしで、AI Gateway 経由の AI リクエスト向けに持続的な WebSocket 接続を確立します。 - [リアルタイム WebSockets API](https://developers.cloudflare.com/ai-gateway/usage/websockets-api/realtime-api/index.md): リアルタイムの WebSocket 連携に対応する AI プロバイダーへ、AI Gateway 経由で接続します。 - [Workers バインディング](https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/index.md): AI Gateway 付きの AI バインディングのリファレンス。env.AI.run() で Workers AI とサードパーティモデルを呼び出し、ログ ID にアクセスし、 フィードバック、ログ、URL 向けのゲートウェイメソッドを使います。 ## 機能 - [機能](https://developers.cloudflare.com/ai-gateway/features/index.md): キャッシュ、レート制限、Guardrails、動的ルーティング、データ損失防止など、AI Gateway の機能を確認します。 - [キャッシュ](https://developers.cloudflare.com/ai-gateway/features/caching/index.md): リクエスト単位でキャッシュ設定を上書きします。 - [データ損失防止(DLP)](https://developers.cloudflare.com/ai-gateway/features/dlp/index.md): Cloudflare DLP の検出エンジンで、AI Gateway のプロンプトと応答に含まれる機密データを保護します。 - [Data Loss Prevention(DLP)を設定する](https://developers.cloudflare.com/ai-gateway/features/dlp/set-up-dlp/index.md): AI Gateway で DLP ポリシーを有効にし、プロンプトと応答の機密データをスキャンします。 - [動的ルーティング](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/index.md): ビジュアルインターフェースまたは JSON 設定を使い、条件、クォータ、フォールバックに基づいて AI Gateway のリクエストをルーティングします。 - [JSON 設定](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/json-configuration/index.md): REST API と JSON 要素の構造を使い、AI Gateway のダイナミックルーティングフローを定義します。 - [動的ルートを使う](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/usage/index.md): OpenAI SDK、直接の HTTP リクエスト、または Workers AI バインディングで、AI Gateway の動的ルートへリクエストを送ります。 - [Guardrails](https://developers.cloudflare.com/ai-gateway/features/guardrails/index.md): AI Gateway のプロンプトとレスポンスを有害コンテンツについて評価し、プロバイダー横断で安全ポリシーを適用します。 - [Guardrails のセットアップ](https://developers.cloudflare.com/ai-gateway/features/guardrails/set-up-guardrail/index.md): AI Gateway の Guardrails を有効にし、プロンプトと応答の有害コンテンツをフラグまたはブロックするよう設定します。 - [対応モデルタイプ](https://developers.cloudflare.com/ai-gateway/features/guardrails/supported-model-types/index.md): AI Gateway Guardrails がテキスト生成、埋め込み、不明なモデルに対して評価する AI モデルタイプを確認します。 - [利用上の注意](https://developers.cloudflare.com/ai-gateway/features/guardrails/usage-considerations/index.md): AI Gateway Guardrails を有効にするときのレイテンシ、可用性、言語対応、Workers AI の使用量を把握します。 - [レート制限](https://developers.cloudflare.com/ai-gateway/features/rate-limiting/index.md): 固定またはスライディングのレート制限で AI Gateway へのトラフィックを制御し、過度なコストや不審なアクティビティを防ぎます。 - [Spend limits](https://developers.cloudflare.com/ai-gateway/features/spend-limits/index.md): モデル、プロバイダー、ユーザーやチームなどのカスタムメタデータディメンションごとに、AI Gateway のコストベースの予算を設定します。 - [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/index.md): Cloudflare の請求で推論リクエストの支払いと認証を行います。 ## 連携 - [連携](https://developers.cloudflare.com/ai-gateway/integrations/index.md): AI Gateway を Workers バインディング、Vercel AI SDK、その他のプラットフォームと接続します。 - [Agents](https://developers.cloudflare.com/agents/index.md): Cloudflare 上で AI 搭載の Agents を構築します - [Workers AI を AI Gateway でセットアップする](https://developers.cloudflare.com/ai-gateway/integrations/aig-workers-ai-binding/index.md): このガイドでは、Workers AI プロジェクトのセットアップとデプロイを説明します。Workers、AI Gateway バインディング、大規模言語モデル(LLM)を使い、Cloudflare のグローバルネットワーク上に最初の AI アプリケーションをデプロイします。 - [コーディングエージェント](https://developers.cloudflare.com/ai-gateway/integrations/coding-agents/index.md): Claude Code、Claude Desktop、GitHub Copilot CLI、OpenAI Codex、OpenCode、Pi を AI Gateway 経由にし、可観測性、キャッシュ、レート制限、コスト追跡を行います。 - [Claude Code](https://developers.cloudflare.com/ai-gateway/integrations/coding-agents/claude-code/index.md): Cloudflare のゲートウェイトークンを使い、Claude Code の通信を AI Gateway 経由にします。 - [Claude Desktop](https://developers.cloudflare.com/ai-gateway/integrations/coding-agents/claude-desktop/index.md): サードパーティ推論の設定と Cloudflare のゲートウェイトークンを使い、Claude Desktop を AI Gateway 経由にします。 - [GitHub Copilot CLI](https://developers.cloudflare.com/ai-gateway/integrations/coding-agents/github-copilot-cli/index.md): REST API と Unified Billing を使い、GitHub Copilot CLI を AI Gateway 経由でルーティングします。 - [OpenAI Codex](https://developers.cloudflare.com/ai-gateway/integrations/coding-agents/openai-codex/index.md): カスタムモデルプロバイダーで OpenAI エンドポイントを指定し、OpenAI Codex の通信を AI Gateway 経由にします。 - [OpenCode](https://developers.cloudflare.com/ai-gateway/integrations/coding-agents/opencode/index.md): ゲートウェイトークン、または Access で保護したカスタムドメインを使い、OpenCode のモデルリクエストを AI Gateway 経由でルーティングします。 - [Pi](https://developers.cloudflare.com/ai-gateway/integrations/coding-agents/pi/index.md): 組み込みの Cloudflare AI Gateway プロバイダーを使い、Pi コーディングエージェントを AI Gateway 経由でルーティングします。 - [Vercel AI SDK](https://developers.cloudflare.com/ai-gateway/integrations/vercel-ai-sdk/index.md): ai-gateway-provider パッケージを使い、Vercel AI SDK のリクエストを AI Gateway 経由にします。 ## チュートリアル - [チュートリアル](https://developers.cloudflare.com/ai-gateway/tutorials/index.md): Workers のデプロイ、プロバイダーの接続、AI アプリケーションの構築に関する、AI Gateway の手順付きチュートリアルです。 - [Workers AI で最初の AI Gateway を作成する](https://developers.cloudflare.com/ai-gateway/tutorials/create-first-aig-workers/index.md): Cloudflare ダッシュボードで Workers AI を使い、最初の AI Gateway を作成する手順を説明します。 - [AI Gateway 経由で Pruna P-video を使う](https://developers.cloudflare.com/ai-gateway/tutorials/pruna-p-video/index.md): AI Gateway 経由で Replicate の prunaai/p-video を呼び出す方法を説明します。 ## 変更履歴 - [変更履歴](https://developers.cloudflare.com/ai-gateway/changelog/index.md): AI Gateway の最新の更新、新機能、修正を確認できます。 ## ヘッダー用語集 - [ヘッダー用語集](https://developers.cloudflare.com/ai-gateway/glossary/index.md): API リクエストの設定、カスタマイズ、管理に使える、AI Gateway が対応するすべてのヘッダーです。 ## REST API リファレンス - [REST API リファレンス](https://developers.cloudflare.comhttps://developers.cloudflare.com/api/resources/ai_gateway/methods/list/index.md): Cloudflare REST API を使い、AI Gateway のリソースをプログラムから管理します。 ## Evaluations - [Evaluations](https://developers.cloudflare.com/ai-gateway/evaluations/index.md): データセット、ヒューマンフィードバック、評価指標で、AI Gateway アプリケーションのパフォーマンスを評価します。 - [ダッシュボードでヒューマンフィードバックを追加する](https://developers.cloudflare.com/ai-gateway/evaluations/add-human-feedback/index.md): Cloudflare ダッシュボードで、AI Gateway のログに高評価または低評価のフィードバックを付けます。 - [API でヒューマンフィードバックを追加する](https://developers.cloudflare.com/ai-gateway/evaluations/add-human-feedback-api/index.md): Cloudflare API を使い、AI Gateway のリクエストログにヒューマンフィードバックを送信します。 - [Worker Bindings でヒューマンフィードバックを追加する](https://developers.cloudflare.com/ai-gateway/evaluations/add-human-feedback-bindings/index.md): Worker bindings を使い、プログラムから AI Gateway の評価にヒューマンフィードバックを送ります。 - [Evaluations のセットアップ](https://developers.cloudflare.com/ai-gateway/evaluations/set-up-evaluations/index.md): データセットの作成、評価指標の選択、AI Gateway ログに対する評価の実行を行います。 ## configuration - [認証済みゲートウェイ](https://developers.cloudflare.com/ai-gateway/configuration/authentication/index.md): 各リクエストに有効な認可トークンを必須にし、セキュリティを高めます。 - [BYOK(キーの保存)](https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/index.md): AI プロバイダーの API キーを AI Gateway に安全に保存し、ゲートウェイ設定から参照します。 - [Cloudflare Access](https://developers.cloudflare.com/ai-gateway/configuration/cloudflare-access/index.md): AI Gateway に ID 対応の制御を追加し、ゲートウェイを呼び出す前に ID プロバイダーでユーザーを認証します。 - [カスタムコスト](https://developers.cloudflare.com/ai-gateway/configuration/custom-costs/index.md): リクエストごとに、デフォルトまたは公開のモデルコストを上書きします。 - [カスタムドメイン](https://developers.cloudflare.com/ai-gateway/configuration/custom-domains/index.md): ai.example.com など、所有しているホスト名経由で AI Gateway へリクエストを送ります。 - [カスタムプロバイダー](https://developers.cloudflare.com/ai-gateway/configuration/custom-providers/index.md): アカウント用のカスタム AI プロバイダーを作成し、管理します。 - [フォールバック](https://developers.cloudflare.com/ai-gateway/configuration/fallbacks/index.md): AI Gateway でモデルまたはプロバイダーのフォールバックを指定し、リクエスト失敗時の信頼性を確保します。 - [ゲートウェイを管理する](https://developers.cloudflare.com/ai-gateway/configuration/manage-gateway/index.md): ダッシュボードまたは API で AI Gateway インスタンスを作成、編集、削除します。 - [リクエスト処理](https://developers.cloudflare.com/ai-gateway/configuration/request-handling/index.md): 信頼性の高い AI プロバイダー連携のために、AI Gateway のリクエストタイムアウトとリトライを設定します。 ## observability - [分析](https://developers.cloudflare.com/ai-gateway/observability/analytics/index.md): ダッシュボードまたは GraphQL で、リクエスト、トークン、キャッシュ、エラー、コストに関する AI Gateway の指標を確認します。 - [コスト](https://developers.cloudflare.com/ai-gateway/observability/costs/index.md): AI Gateway のコスト指標を使い、AI プロバイダー横断のトークンベースのコストを追跡・見積もりします。 - [カスタムメタデータ](https://developers.cloudflare.com/ai-gateway/observability/custom-metadata/index.md): ユーザー ID などのカスタムメタデータで AI Gateway リクエストにタグを付け、ログの絞り込みと分析をしやすくします。 - [ログ分類](https://developers.cloudflare.com/ai-gateway/observability/log-classification/index.md): AI Gateway のトラフィックをタスク別に分類し、各モデルがタスク要件に合うかを評価します。 - [ログ](https://developers.cloudflare.com/ai-gateway/observability/logging/index.md): プロンプト、応答、トークン、コスト、DLP アクションを含む、AI Gateway のリクエストログを保存して確認します。 - [Workers Logpush](https://developers.cloudflare.com/ai-gateway/observability/logging/logpush/index.md): Workers Logpush を使い、暗号化した AI Gateway のログを外部ストレージへエクスポートします。 - [OpenTelemetry](https://developers.cloudflare.com/ai-gateway/observability/otel-integration/index.md): AI Gateway のトレーススパンを OpenTelemetry 互換バックエンドにエクスポートし、分散トレーシングとパフォーマンス監視に使えます。 - [User Insights](https://developers.cloudflare.com/ai-gateway/observability/user-insights/index.md): 組織全体の AI 支出を把握し、利用を ID に紐付け、AI Gateway で異常なセッションを検出します。 ## reference - [監査ログ](https://developers.cloudflare.com/ai-gateway/reference/audit-logs/index.md): ゲートウェイの作成、削除、更新など、AI Gateway の設定変更に関する監査ログを確認します。 - [制限](https://developers.cloudflare.com/ai-gateway/reference/limits/index.md): ゲートウェイ、ログ保存、キャッシュサイズ、メタデータ件数、Logpush ジョブなど、AI Gateway の制限を確認します。 - [料金](https://developers.cloudflare.com/ai-gateway/reference/pricing/index.md): AI Gateway の料金を確認します。無料のコア機能、永続ログの保存上限、プレミアムアドオンを含みます。 - [トラブルシューティング](https://developers.cloudflare.com/ai-gateway/reference/troubleshooting/index.md): 認証エラー、ログが表示されない問題、プロバイダー接続の不具合など、AI Gateway のよくある問題を解決します。 ## アーキテクチャ - [アーキテクチャ](https://developers.cloudflare.com/ai-gateway/demos/index.md): AI Gateway をインフラに組み込んだリファレンスアーキテクチャとデザインガイドを確認します。