主な機能
- リアルタイム音声 - テキストと音声の入出力
- 設定可能な推論 - 音声ワークフローに合わせて推論強度を調整
- ツールの使用 - リアルタイムセッションでの関数呼び出しに対応
- マルチモーダル入力 - テキスト、音声、画像の入力を受け付ける
簡単な使用例
Node.js WebSocket
wsパッケージをインストールし、modelクエリパラメーターとBearerトークンを使用して接続してください。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
GPT-Realtime-2: 推論とツール利用に対応したリアルタイム音声モデル。
wsパッケージをインストールし、modelクエリパラメーターとBearerトークンを使用して接続してください。
import WebSocket from "ws";
const ws = new WebSocket(
"wss://api.mixroute.ai/v1/realtime?model=gpt-realtime-2",
{ headers: { Authorization: "Bearer YOUR_API_KEY" } },
);
ws.on("open", () => {
ws.send(JSON.stringify({
type: "response.create",
response: { modalities: ["text"] },
}));
});
ws.on("message", (data) => console.log(data.toString()));
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | はい | gpt-realtime-2である必要があります。 |
Authorization | header | はい | WebSocketハンドシェイク時に送信するBearer APIキー。 |
session.update | event | いいえ | modalities、instructions、tools、audio、reasoningを設定します。 |
response.create | event | はい | 現在のセッションでモデルによる生成を開始します。 |