Skip to main content
xAI provides realtime speech-to-speech over WebSocket with server-side voice activity detection, built-in web search, and X search. No separate STT/TTS needed.
Vision Agents uses Stream Video for real-time WebRTC transport by default. External WebRTC transports are supported as well. Most AI providers offer free tiers to get started.
xAI also provides a traditional LLM and standalone text-to-speech.

Installation

Quick start

Set XAI_API_KEY in your environment or pass api_key directly.

Parameters

vad_interrupt_response defaults to False because speaker-to-mic echo can cause the server to cancel the agent’s own response mid-sentence. Set to True only if your audio setup avoids echo feedback.

Function calling

See the Function Calling guide for details.

Next steps

xAI LLM

Advanced reasoning with Grok

xAI TTS

Text-to-speech with expressive voices