> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vapi.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vapi.ai/_mcp/server.

# xAI

> Configure xAI as your Vapi assistant's text-to-speech provider, including supported voices, languages, and voice options.

xAI provides text-to-speech for Vapi voice agents.

You can use xAI through Vapi's default integration, or connect your own account in [Integrations](/providers/integrations).

## Supported capability

| Capability     | Provider value |
| -------------- | -------------- |
| Text-to-speech | `xai`          |

## Text-to-speech

Set `voice.provider` to `xai` and choose one of the five voices Vapi currently supports. The `language` and `speed` fields are optional.

```bash
curl -X PATCH "https://api.vapi.ai/assistant/ASSISTANT_ID" \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "voice": {
      "provider": "xai",
      "voiceId": "eve",
      "language": "en",
      "speed": 1.1
    }
  }'
```

For additional API configuration options, review the [`XaiVoice` fields](/api-reference/assistants/create#request.body.voice.XaiVoice) in the Create Assistant API reference.

| Voice | Voice ID |
| ----- | -------- |
| Eve   | `eve`    |
| Ara   | `ara`    |
| Rex   | `rex`    |
| Sal   | `sal`    |
| Leo   | `leo`    |

### Voice options

| Field            | Required | Vapi default | Description                                                                      |
| ---------------- | -------- | ------------ | -------------------------------------------------------------------------------- |
| `voiceId`        | Yes      | None         | One of the built-in voice IDs above.                                             |
| `language`       | No       | `en`         | A supported BCP-47 language code, or `auto` for automatic detection.             |
| `speed`          | No       | `1.1`        | Speech-speed multiplier from `0.7` to `1.5`. xAI's direct API defaults to `1.0`. |
| `cachingEnabled` | No       | `true`       | Whether Vapi may cache synthesized audio.                                        |

### Supported languages

| Language                      | Language code |
| ----------------------------- | ------------- |
| Arabic (Egypt)                | `ar-EG`       |
| Arabic (Saudi Arabia)         | `ar-SA`       |
| Arabic (United Arab Emirates) | `ar-AE`       |
| Automatic detection           | `auto`        |
| Bengali                       | `bn`          |
| Chinese (Simplified)          | `zh`          |
| English                       | `en`          |
| French                        | `fr`          |
| German                        | `de`          |
| Hindi                         | `hi`          |
| Indonesian                    | `id`          |
| Italian                       | `it`          |
| Japanese                      | `ja`          |
| Korean                        | `ko`          |
| Portuguese (Brazil)           | `pt-BR`       |
| Portuguese (Portugal)         | `pt-PT`       |
| Russian                       | `ru`          |
| Spanish (Mexico)              | `es-MX`       |
| Spanish (Spain)               | `es-ES`       |
| Turkish                       | `tr`          |
| Vietnamese                    | `vi`          |

## Related

#### [xAI language models](/providers/model/xai)

Configure xAI for language models.

#### [xAI speech-to-text](/providers/transcriber/xai)

Configure xAI for speech-to-text.

#### [Voice providers](/providers/voice/overview)

Compare every voice provider Vapi supports.