> ## 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: reasoning-capable realtime voice model with tool use.

GPT-Realtime-2 is OpenAI's reasoning-capable realtime voice model for speech-to-speech agents and tool use.

Use the Realtime WebSocket endpoint. The Chat Completions endpoint is not supported for this MixRoute route.

## Key capabilities

* Realtime speech - Text and audio input and output
* Configurable reasoning - Adjust reasoning effort for voice workflows
* Tool use - Supports function calls in realtime sessions
* Multimodal input - Accepts text, audio, and image input

## Quick example

### Node.js WebSocket

Install the `ws` package, then connect with the model query parameter and a 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()));
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `model` | string | Yes | Must be `gpt-realtime-2`. |
| `Authorization` | header | Yes | Bearer API key sent during the WebSocket handshake. |
| `session.update` | event | No | Configure modalities, instructions, tools, audio, and reasoning. |
| `response.create` | event | Yes | Start model generation for the current session. |

## Vendor reference

* [OpenAI GPT-Realtime-2 model page](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.