Play with the Grok Voice Agent API in this LiveKit-powered playground
Overview
SpaceXAI's Grok models are available in LiveKit Agents through LiveKit Inference and the SpaceXAI plugin. With LiveKit Inference, your agent runs on LiveKit's infrastructure to minimize latency. No separate provider API key is required, and usage and rate limits are managed through LiveKit Cloud. Use the plugin instead if you want to manage your own billing and rate limits.
Try it out
Talk to a patient intake agent running entirely on Grok. It takes a caller through a front-desk conversation at a family medicine practice: describing a symptom, routing new versus returning patients, offering appointment times, and handling a change of mind about scheduling.
Book a visit, ask what the office hours are, or request a refill.
SpaceXAI ecosystem support
LiveKit Agents supports the following SpaceXAI models and APIs:
- Grok Models: A family of state-of-the-art, high-performance LLMs.
- Grok Text to Speech API: A text-to-speech model delivering natural, expressive voices.
- Grok Speech to Text API: A speech-to-text model enabling low-latency, accurate transcriptions.
- Grok Voice Agent API: A speech-to-speech realtime model, API compatible with OpenAI's Realtime API.
Getting started
Use the Voice AI quickstart to build a voice AI app with Grok.
Voice AI quickstart
Build your first voice AI app with Grok.
LiveKit Inference
Set each stage of your AgentSession to a Grok model ID:
| Stage | Model ID |
|---|---|
| Speech-to-text | xai/stt-1 |
| Language model | xai/grok-4.20-0309-non-reasoning |
| Text-to-speech | xai/tts-1 |
from livekit.agents import AgentSession, inferencesession = AgentSession(stt=inference.STT(model="xai/stt-1", language="en"),llm=inference.LLM(model="xai/grok-4.20-0309-non-reasoning"),tts=inference.TTS(model="xai/tts-1", voice="carina"),expressive=True,# ... vad, turn_handling)
import { AgentSession, inference } from '@livekit/agents';const session = new AgentSession({stt: new inference.STT({ model: 'xai/stt-1', language: 'en' }),llm: new inference.LLM({ model: 'xai/grok-4.20-0309-non-reasoning' }),tts: new inference.TTS({ model: 'xai/tts-1', voice: 'carina' }),expressive: true,// ... vad, turnHandling});
Expressive delivery
Expressive mode works with xai/tts-1, so the LLM adds pacing and non-verbal delivery inline without any prompt changes.
SpaceXAI's expressive delivery comes from prosody, non-verbal sounds, and pauses rather than a mood label, so it doesn't publish an lk.expression value and can't drive the mood UI. See SpaceXAI TTS.
Voices
The full SpaceXAI voice roster is available through Inference. For professional and clinical scenarios, rigel is precise and professional, celeste is compassionate and confident, and carina is soft and empathetic. See SpaceXAI TTS for the complete list.
Zero data retention
Traffic through LiveKit Inference to SpaceXAI runs under zero data retention. Your prompts, audio, and model outputs pass through only to generate a response, and neither LiveKit nor SpaceXAI logs, stores, or trains on your data.
LiveKit Agents overview
LiveKit Agents is an open source framework for building realtime AI apps in Python and Node.js. It supports complex voice AI workflows with multiple agents and discrete processing steps, and includes built-in load balancing.
LiveKit provides SIP support for telephony integration and full-featured frontend SDKs in multiple languages. It uses WebRTC transport for end-user devices, enabling high-quality, low-latency realtime experiences. To learn more, see LiveKit Agents.
Additional resources
The following links provide more information on each available SpaceXAI component in LiveKit Agents.
Grok LLM
LiveKit Agents plugin for Grok models.
Grok TTS
LiveKit Agents plugin for Grok Text to Speech API.
Grok STT
LiveKit Agents plugin for Grok Speech to Text API.
Grok Voice Agent API
LiveKit Agents plugin for Grok Voice Agent API.
Expressive mode
Let the LLM shape SpaceXAI delivery with prosody, sounds, and pauses automatically.