147| Parameter | Type | Description |147| Parameter | Type | Description |
148|-----------|------|-------------|148|-----------|------|-------------|
149| `instructions` | string | System prompt |149| `instructions` | string | System prompt |
150| `reasoning_effort` | `"high"` | `"none"` | optional | Controls whether the model uses reasoning. Defaults to `"high"`. Supported only with `grok-voice-latest` and `grok-voice-think-fast-1.0`. |
150| `voice` | string | Voice selection: `eve`, `ara`, `rex`, `sal`, `leo`, or a [custom voice ID](/developers/model-capabilities/audio/custom-voices) (see [Available Voices](#available-voices)) |151| `voice` | string | Voice selection: `eve`, `ara`, `rex`, `sal`, `leo`, or a [custom voice ID](/developers/model-capabilities/audio/custom-voices) (see [Available Voices](#available-voices)) |
151| `tools` | array | Tools available to the voice agent. Supports `file_search`, `web_search`, `x_search`, `mcp`, and `function` types. See [Using Tools](#using-tools-with-grok-voice-agent-api). |152| `tools` | array | Tools available to the voice agent. Supports `file_search`, `web_search`, `x_search`, `mcp`, and `function` types. See [Using Tools](#using-tools-with-grok-voice-agent-api). |
152| `turn_detection.type` | string | null | `"server_vad"` for automatic detection, `null` for manual text turns |153| `turn_detection.type` | string | null | `"server_vad"` for automatic detection, `null` for manual text turns |
1449 1450
1450async def main():1451async def main():
1451 async with client.realtime.connect(1452 async with client.realtime.connect(
14521453 model="grok-voice-think-fast-1.0" model="grok-voice-latest"
1453 ) as conn:1454 ) as conn:
1454 await conn.session.update(session={1455 await conn.session.update(session={
1455 "voice": "eve",1456 "voice": "eve",
1475});1476});
1476 1477
1477// Pass the configured client so the connection uses the xAI base URL and key1478// Pass the configured client so the connection uses the xAI base URL and key
14781479const rt = new OpenAIRealtimeWS({ model: "grok-voice-think-fast-1.0" }, client);const rt = new OpenAIRealtimeWS({ model: "grok-voice-latest" }, client);
1479 1480
1480rt.on("session.created", () => {1481rt.on("session.created", () => {
1481 rt.send({1482 rt.send({
1508# headers = {"Authorization": f"Bearer {os.environ['OPENAI_API_KEY']}"}1509# headers = {"Authorization": f"Bearer {os.environ['OPENAI_API_KEY']}"}
1509 1510
1510# After (xAI)1511# After (xAI)
15111512url = "wss://api.x.ai/v1/realtime?model=grok-voice-think-fast-1.0"url = "wss://api.x.ai/v1/realtime?model=grok-voice-latest"
1512headers = {"Authorization": f"Bearer {os.environ['XAI_API_KEY']}"}1513headers = {"Authorization": f"Bearer {os.environ['XAI_API_KEY']}"}
1513 1514
1514async with websockets.connect(url, additional_headers=headers) as ws:1515async with websockets.connect(url, additional_headers=headers) as ws:
1524// const headers = { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` };1525// const headers = { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` };
1525 1526
1526// After (xAI)1527// After (xAI)
15271528const url = "wss://api.x.ai/v1/realtime?model=grok-voice-think-fast-1.0";const url = "wss://api.x.ai/v1/realtime?model=grok-voice-latest";
1528const headers = { Authorization: `Bearer ${process.env.XAI_API_KEY}` };1529const headers = { Authorization: `Bearer ${process.env.XAI_API_KEY}` };
1529 1530
1530const ws = new WebSocket(url, { headers });1531const ws = new WebSocket(url, { headers });
1540 1541
1541```python customLanguage="pythonWithoutSDK"1542```python customLanguage="pythonWithoutSDK"
1542# Pass the model in connect()1543# Pass the model in connect()
15431544async with client.realtime.connect(model="grok-voice-think-fast-1.0") as conn:async with client.realtime.connect(model="grok-voice-latest") as conn:
1544 ...1545 ...
1545```1546```
1546 1547
1547```javascript customLanguage="javascriptWithoutSDK"1548```javascript customLanguage="javascriptWithoutSDK"
1548// Pass the model in the OpenAIRealtimeWS constructor1549// Pass the model in the OpenAIRealtimeWS constructor
15491550const rt = new OpenAIRealtimeWS({ model: "grok-voice-think-fast-1.0" }, client);const rt = new OpenAIRealtimeWS({ model: "grok-voice-latest" }, client);
1550```1551```
1551 1552
1552### Step 3 — Model-Specific Best Practices1553### Step 3 — Model-Specific Best Practices
1553 1554
1554#### `grok-voice-think-fast-1.0` (Recommended)1555#### `grok-voice-think-fast-1.0` (Recommended)
1555 1556
15561557This is the flagship voice model — more capable and generalizable than GPT realtime models. When migrating:This is the flagship voice model. Use `grok-voice-latest` for new integrations so your app tracks the current recommended model. When migrating:
1557 1558
1558* **Simplify your system prompt.** The model is significantly more capable, so your prompt should be much shorter. Ask Grok to generalize your existing system prompt rather than porting it verbatim.1559* **Simplify your system prompt.** The model is significantly more capable, so your prompt should be much shorter. Ask Grok to generalize your existing system prompt rather than porting it verbatim.
1559* **Remove workaround prompting.** Prompt hacks and edge-case fixes needed for GPT models are unnecessary. Strip out instructions added solely to patch bugs or limitations of the previous model.1560* **Remove workaround prompting.** Prompt hacks and edge-case fixes needed for GPT models are unnecessary. Strip out instructions added solely to patch bugs or limitations of the previous model.
15601561* **Leverage stronger reasoning.** The model handles complex multi-step instructions, nuanced tone, and ambiguous queries out of the box.* **Reasoning is enabled by default.** The default `reasoning_effort` is `"high"` for complex multi-step instructions, nuanced tone, and ambiguous queries. Set it to `"none"` to disable reasoning.
1561 1562
15621563#### `grok-voice-fast-1.0`#### Deprecated model
1563 1564
15641565A drop-in replacement with similar prompting characteristics to GPT realtime models:This model remains available for existing integrations, but new applications should use `grok-voice-latest`.
1565 1566
15661567* **Minimal prompt changes required.** Your existing system prompt and instructions can be used as-is with little to no modification.* `grok-voice-fast-1.0`: Legacy voice model with similar prompting characteristics to GPT realtime models.
15671568* **Same event flow.** All client and server events follow the same patterns — swap the URL and key, and your application should work immediately.
1569The deprecated model follows the same client and server event flow as `grok-voice-latest`, so existing integrations can pin to it while migrating.
1568 1570
1569> [!NOTE]1571> [!NOTE]
1570>1572>