XAITTS
Streaming text-to-speech with xAI’s Grok voices, using your own xAI API key. Supports inline expression tags like [laugh] and <whisper> in the text. Authenticates with XAI_API_KEY from your environment, or an explicitapi_key.
Fields
str
default:"UNSET"
Built-in voice (“eve”, “ara”, “rex”, “sal”, “leo”) or a custom voice ID. Defaults to ‘eve’.
str
default:"UNSET"
BCP-47 language code, e.g. “en”, “fr” or “pt-BR”, or “auto” to detect the language from the text. Defaults to ‘en’.
Literal['pcm', 'mulaw']
default:"UNSET"
Audio encoding of the generated speech: “pcm” (16-bit linear) or “mulaw”. Defaults to ‘pcm’.
int
default:"UNSET"
Output sample rate in Hz: 8000, 16000, 22050, 24000, 44100 or 48000. Defaults to 24000.
int
default:"UNSET"
0 for best quality, or 1 for faster time-to-first-audio with a slight quality tradeoff. Defaults to 0.
bool
default:"UNSET"
Convert numbers, abbreviations and symbols into spoken words before synthesis. Defaults to False.
str
default:"UNSET"
WebSocket URL of the xAI text-to-speech endpoint. Defaults to ‘wss://api.x.ai/v1/tts’.
float
default:"UNSET"
Seconds after which the streaming connection is reopened, to stay within xAI session limits. Defaults to 300.0.