> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Xai

> TypeScript API reference for the xai text-to-speech provider.

## XAITTS

Initialize the xAI TTS plugin.

```ts theme={null}
import { XAITTS } from '@zeroruntime/js-sdk/plugins';  // direct to the vendor, with your key
```

### Options

<ParamField path="voice" type="string" default="eve" />

<ParamField path="language" type="string" default="en" />

<ParamField path="codec" type="'pcm' | 'mulaw'" default="pcm" />

<ParamField path="sample_rate" type="number" default="24000" />

<ParamField path="optimize_streaming_latency" type="number" default="0" />

<ParamField path="text_normalization" type="boolean" default="false" />

<ParamField path="base_url" type="string" default="wss://api.x.ai/v1/tts" />

<ParamField path="max_connection_age_sec" type="number" default="300" />
