# Grok Voice

> Build real-time voice applications powered by Grok. Stream audio and text bidirectionally via WebSocket for voice assistants, phone agents, and interactive voice systems.


## Overview

- **Endpoint**: `https://fal.run/xai/grok-voice/realtime`
- **Model ID**: `xai/grok-voice/realtime`
- **Category**: speech-to-speech
- **Kind**: inference
**Tags**: xai, grok, voice, agent, realtime, websocket



## Pricing

- **Price**: $0.00083 per seconds

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`prompt`** (`string`, _optional_):
  System instructions describing the agent's persona and conversation context. Uses Grok's default persona when omitted. Default value: `"null"`
  - Default: `null`

- **`voice`** (`Enum`, _optional_):
  Built-in xAI voice for the agent's speech. Uses Grok's default voice when omitted.
  - Default: `null`
  - Options: `"carina"`, `"zagan"`, `"helix"`, `"orion"`, `"luna"`, `"iris"`, `"altair"`, `"zenith"`, `"perseus"`, `"helios"`, `"lux"`, `"kepler"`, `"rigel"`, `"cosmo"`, `"celeste"`, `"ursa"`, `"sirius"`, `"lumen"`, `"castor"`, `"naksh"`, `"atlas"`, `"aurora"`, `"liora"`, `"ara"`, `"eve"`, `"leo"`, `"rex"`, `"sal"`

- **`turn_detection`** (`GrokTurnDetectionConfiguration`, _optional_):
  Automatic turn detection: any configured object (even empty) lets the agent detect when you stop speaking and reply on its own. Set null for manual turns; omit to keep the session default.
  - Default: `null`

- **`type`** (`string`, _required_):
  xAI realtime event type (e.g. 'session.update', 'input_audio_buffer.append', 'response.create', 'response.output_audio.delta'). Events are relayed verbatim in both directions.
  - Examples: "session.update", "input_audio_buffer.append", "response.create"

- **`tools`** (`GrokToolsConfiguration`, _optional_):
  Server-side tools available to the agent. Web, X, and remote MCP tools are supported; every tool is disabled by default. An explicitly supplied object always reaches the session, so previously enabled tools can be cleared.
  - Default: `null`



**Required Parameters Example**:

```json
{
  "type": "session.update"
}
```


### Output Schema

The API returns the following output format:

- **`prompt`** (`string`, _optional_):
  System instructions describing the agent's persona and conversation context. Uses Grok's default persona when omitted. Default value: `"null"`
  - Default: `null`

- **`voice`** (`Enum`, _optional_):
  Built-in xAI voice for the agent's speech. Uses Grok's default voice when omitted.
  - Default: `null`
  - Options: `"carina"`, `"zagan"`, `"helix"`, `"orion"`, `"luna"`, `"iris"`, `"altair"`, `"zenith"`, `"perseus"`, `"helios"`, `"lux"`, `"kepler"`, `"rigel"`, `"cosmo"`, `"celeste"`, `"ursa"`, `"sirius"`, `"lumen"`, `"castor"`, `"naksh"`, `"atlas"`, `"aurora"`, `"liora"`, `"ara"`, `"eve"`, `"leo"`, `"rex"`, `"sal"`

- **`turn_detection`** (`GrokTurnDetectionConfiguration`, _optional_):
  Automatic turn detection: any configured object (even empty) lets the agent detect when you stop speaking and reply on its own. Set null for manual turns; omit to keep the session default.
  - Default: `null`

- **`type`** (`string`, _required_):
  xAI realtime event type (e.g. 'session.update', 'input_audio_buffer.append', 'response.create', 'response.output_audio.delta'). Events are relayed verbatim in both directions.
  - Examples: "session.update", "input_audio_buffer.append", "response.create"

- **`tools`** (`GrokToolsConfiguration`, _optional_):
  Server-side tools available to the agent. Web, X, and remote MCP tools are supported; every tool is disabled by default. An explicitly supplied object always reaches the session, so previously enabled tools can be cleared.
  - Default: `null`



**Example Response**:

```json
{
  "type": "session.update"
}
```


## Usage Examples

### cURL

```bash
curl --request WEBSOCKET \
  --url https://fal.run/xai/grok-voice/realtime \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "type": "session.update"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "xai/grok-voice/realtime",
    arguments={
        "type": "session.update"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("xai/grok-voice/realtime", {
  input: {
    type: "session.update"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/xai/grok-voice/realtime)
- [API Documentation](https://fal.ai/models/xai/grok-voice/realtime/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=xai/grok-voice/realtime)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
