AI GatewayがOpenAIのResponses APIをサポート
VercelのAI GatewayがOpenAIのResponses APIをサポートし、単一インターフェースから複数のプロバイダーへリクエストをルーティング可能になった。
キーポイント
Responses APIの公式サポート
AI GatewayがOpenAIの新しいResponses APIを正式にサポートし、既存のChat Completions APIとは異なるフラットな入出力形式と組み込みの推論機能を利用可能にした。
マルチプロバイダー統合とルーティング
TypeScriptおよびPython SDKを用いて、OpenAI、Anthropic、Googleなど複数のモデルプロバイダーをモデル名の変更のみで切り替えられるルーティング機能を提供する。
高度な機能の統一インターフェース
ストリーミング、ツール呼び出し、構造化出力(JSONスキーマ)、そして推論レベルの制御を、プロバイダー固有の設定を意識せずに統一されたパラメータで実行できる。
影響分析・編集コメントを表示
影響分析
このアップデートは、マルチモデル戦略を取る開発者にとって実用性が極めて高い。OpenAIの新しいAPI仕様をそのまま抽象化レイヤーに組み込むことで、ベンダーロックインのリスクを軽減しつつ、最新機能(特に推論制御)を活用できる道を開いた。業界全体として、API互換性の標準化とマルチプロバイダー管理の容易さがさらに推進される。
編集コメント
Vercel AI GatewayがOpenAIの最新API形式に対応したことは、マルチモデル運用における開発効率をさらに高める重要な一歩です。特に「推論レベル」の統一制御は、コストと精度のバランスを取る上で実用的な機能と言えます。
タイトル: 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
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み