> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixroute.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-Realtime-2

> GPT-Realtime-2: 推論とツール利用に対応したリアルタイム音声モデル。

GPT-Realtime-2は、音声対話エージェントとツール利用向けの、推論に対応したOpenAIのリアルタイム音声モデルです。

RealtimeのWebSocketエンドポイントを使用してください。このMixRouteルートではChat Completionsエンドポイントはサポートされていません。

## 主な機能

* リアルタイム音声 - テキストと音声の入出力
* 設定可能な推論 - 音声ワークフローに合わせて推論強度を調整
* ツールの使用 - リアルタイムセッションでの関数呼び出しに対応
* マルチモーダル入力 - テキスト、音声、画像の入力を受け付ける

## 簡単な使用例

### Node.js WebSocket

`ws`パッケージをインストールし、modelクエリパラメーターとBearerトークンを使用して接続してください。

```javascript theme={null}
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 | はい | 現在のセッションでモデルによる生成を開始します。 |

## ベンダーの参考資料

* [OpenAI GPT-Realtime-2モデルページ](https://developers.openai.com/api/docs/models/gpt-realtime-2)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.