AI GatewayがOpenAIのResponses APIをサポート
本文の状態
日本語全文を表示中
詳細モードで約3分の本文を読めます。
同じ出来事の情報源
6媒体で確認
Vercel Blog · LY Corp Tech Blog · TechCrunch AI · Ars Technica AI · The Verge AI · TLDR AI
各社の報じ方を比較 ↓AI GatewayがOpenAIのResponses APIをサポートした。開発者は既存のOpenAI SDKを使用し、単一インターフェースで複数プロバイダーのモデルにリクエストをルーティングできるようになった。Responses APIはChat Completions APIの代替で、よりフラットな入出力形式と組み込み推論機能を備える。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
タイトル: AI GatewayがOpenAIのResponses APIをサポート
AI GatewayがOpenAIのResponses APIをサポートしました。使い慣れたOpenAI SDKをそのまま使用し、その接続先をAI Gatewayに向けるだけで、単一のインターフェースを通じてあらゆるプロバイダーのモデルにリクエストをルーティングできます。
Responses APIはChat Completions APIの代替となるもので、AI Gatewayが全エンドポイントで使用しているものと同一のルーティング形式を採用しています。Chat Completionsと比較し、Responses APIはよりフラットな入出力形式を中心に設計されており、推論機能が組み込まれています。
Responses APIの全機能は、これまでAI SDKとChat Completions APIを介してAI Gatewayから利用可能でしたが、今回からResponses APIを直接使用できるようになりました。TypeScriptとPythonの両方をサポートしています。
できること
テキスト生成とストリーミング: プロンプトを送信し、応答を受け取れます。トークンは到着次第ストリーミングできます。
ツール呼び出し: モデルが構造化された引数で呼び出せる関数を定義し、その結果をマルチターンワークフローにフィードバックできます。
構造化出力: 確実なパースのため、応答を指定したJSONスキーマに制約できます。
推論: 単一のパラメータで、プロバイダー間で一貫して思考の深さを制御できます。
プロバイダールーティング: モデル文字列を変更するだけで、OpenAI、Anthropic、Googleなどのプロバイダーを切り替えられます。
はじめに
まず、TypeScriptまたはPython用のOpenAI SDKをインストールしてください。その後、クライアントを初期化する際に、ベースURLをAI Gatewayのエンドポイントに設定し、APIキーを指定します。
TypeScriptのセットアップ:
Pythonも同様に動作します:
テキスト生成
サポートされているあらゆるモデルにプロンプトを送信し、テキスト応答を受け取ることができます。プロバイダーを切り替えるには、モデル文字列をopenai/gpt-5.4から、creator/model形式に従ったAI Gateway経由の他のモデルに変更します。
ストリーミング
インタラクティブなインターフェースでは、トークンが生成されると同時にストリーミングできます。Responses APIはサーバー送信イベントを使用し、出力をリアルタイムで配信します。
ツール呼び出し
会話中にモデルが呼び出せる特定の関数を定義できます。モデルが外部データを必要とする場合、通常のテキストの代わりに関数呼び出しを返します。
アプリケーション側でその関数を実行し、結果を次のリクエストにフィードバックすることで、対話を継続できます。
構造化出力
構造化出力を強制することで、モデルが厳密なスキーマ要件に合致したデータを返すことを保証できます。
推論
Responses APIは、複雑なタスク向けに設定可能な推論機能を導入しています。推論パラメータを調整することで、モデルが最終的な答えを生成する前に処理に費やす時間を制御できます。effortパラメータはnone、minimal、low、medium、high、xhighを受け付けます。AI Gatewayはこの設定を各プロバイダー固有の推論設定にマッピングするため、各プロバイダーのAPIを個別に学ぶ必要はありません。
統合の詳細については、AI Gatewayのドキュメントをご覧ください。サポートされているモデルとプロバイダーの完全なリストも閲覧できます。
詳細情報
- Responses APIドキュメントを読む
- サポートされている全モデルを閲覧する
続きを読む
原文を表示
AI Gateway now supports OpenAI's Responses API. You can use the OpenAI SDK you already know, point it at AI Gateway, and route requests to models from all providers through a single interface.
The Responses API is an alternative to the Chat Completions API and relies on the exact same routing format that AI Gateway uses across all its endpoints. Compared to Chat Completions, Responses API is designed around a flatter input/output format and has built in reasoning support.
All of the functionality in the Responses API was already accessible through AI Gateway via the AI SDK and Chat Completions API, but you can now use the Responses API directly. TypeScript and Python support are both available.
What you can do
Text generation and streaming: Send prompts, get responses, stream tokens as they arrive.
Tool calling: Define functions the model can invoke with structured arguments, feed results back for multi-turn workflows.
Structured output: Constrain responses to a JSON schema for reliable parsing.
Reasoning: Control thinking effort with a single parameter across providers.
Provider routing: Switch between OpenAI, Anthropic, Google, and more by changing the model string.
Getting started
To begin, install the OpenAI SDK for either TypeScript or Python. Then, initialize the client by setting your base URL to the AI Gateway endpoint and providing your API key.
Setup for TypeScript:
Python works the same way:
Text generation
You can send a prompt and receive a text response from any supported model. To switch providers, change the model string from openai/gpt-5.4 to any other models through AI Gateway following the creator/model format.
Streaming
For interactive interfaces, you can stream tokens as they generate. The Responses API uses server-sent events to deliver the output in real time.
Tool calling
You can define specific functions that the model can invoke during a conversation. When the model needs external data, it returns a function call instead of standard text.
Your application executes that function and feeds the results back into a follow-up request to continue the interaction.
Structured output
You can enforce structured outputs to ensure the model returns data that matches your exact schema requirements.
Reasoning
The Responses API introduces configurable reasoning capabilities for complex tasks. You can adjust the reasoning parameters to control how much time the model spends processing before it generates a final answer. The effort parameter accepts none, minimal, low, medium, high, or xhigh. AI Gateway maps this to provider-specific reasoning settings, so you don't need to learn each provider's API.
Explore the AI Gateway documentation to learn more about the integration. You can also view the complete list of supported models and providers.
More information
Read the Responses API documentation.
View all supported models.
Read more
同じ出来事を6媒体で確認
同じ出来事を扱う別媒体の記事です。見出しと公開時刻を比較できます。
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み