# Grok Voice

> Build real-time voice applications powered by Grok. Send recorded audio and get a voice and text response.


## Overview

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



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


- **`audio_url`** (`string`, _required_):
  URL of the audio containing the user's speech. The Grok agent listens to it and replies with speech. Most common audio formats are supported; the audio is converted to 16-bit 24 kHz mono PCM before being sent to Grok. Maximum duration 10 minutes, maximum file size 50 MB.
  - Examples: "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav"

- **`prompt`** (`string`, _optional_):
  Optional system instructions describing the agent's persona and conversation context. Uses Grok's default persona when omitted.
  - Examples: "You are a friendly assistant. Answer briefly and concretely."

- **`voice`** (`Enum`, _optional_):
  Built-in xAI voice for the agent's reply. Uses Grok's default voice when omitted.
  - 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"`

- **`tools`** (`GrokToolsConfiguration`, _optional_):
  Server-side tools available to the agent. Web, X, and remote MCP tools are supported; every tool is disabled by default. file_search/collections are unsupported by the typed configuration due to ZDR.



**Required Parameters Example**:

```json
{
  "audio_url": "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav"
}
```

**Full Example**:

```json
{
  "audio_url": "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav",
  "prompt": "You are a friendly assistant. Answer briefly and concretely."
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  The Grok agent's spoken response (WAV, 24 kHz mono).

- **`text`** (`string`, _optional_):
  Transcript of the agent's spoken response, when Grok provides one (empty string otherwise). Default value: `""`
  - Default: `""`

- **`duration`** (`float`, _required_):
  Duration of the generated audio in seconds.
  - Examples: 7.4



**Example Response**:

```json
{
  "audio": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "duration": 7.4
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/xai/grok-voice \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "audio_url": "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav"
   }'
```

### 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",
    arguments={
        "audio_url": "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav"
    },
    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", {
  input: {
    audio_url: "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav"
  },
  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)
- [API Documentation](https://fal.ai/models/xai/grok-voice/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=xai/grok-voice)

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