> ## 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

Install the `ws` package, then connect with the model query parameter and Bearer token.

```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 Key。 |
| `session.update`  | event  | 否  | 設定模態、指令、工具、音訊與推理。                |
| `response.create` | event  | 是  | 為目前工作階段啟動模型生成。                   |

## 廠商資料

* [OpenAI GPT-Realtime-2 模型頁面](https://developers.openai.com/api/docs/models/gpt-realtime-2)
