livekit-plugins-spatius to send avatar speech audio to Spatius and receive Spatius-published audio and motion data in the LiveKit room.
Using the LiveKit Agents framework
If you already use LiveKit Agents to build your voice agent, add livekit-plugins-spatius. The package hooks into your agent pipeline and sends TTS audio to Spatius; Motion Server publishes the lip-synced audio and motion stream into your LiveKit room. For avatar speech audio source and timing guidance, see Audio. For a working end-to-end reference, see AvatarKit Voice Agent Demo.How it works
- Your agent runs as usual (VAD, STT, LLM, TTS or Realtime), your current AgentSession setup.
livekit-plugins-spatiusintercepts TTS audio from the agent and sends it to Spatius.- Motion Server generates motion data from the agent audio and publishes the synchronized audio + motion stream to the same LiveKit room.
- Your client joins the room and uses the Spatius RTC client to render the avatar.
livekit-plugins-spatius.
livekit-plugins-spatius
Installlivekit-plugins-spatius tracks specific livekit-agents releases. Pin both in your pyproject.toml together — letting your resolver pull the newest livekit-agents independently can drift past what the plugin supports and break AgentSession construction at runtime. The quickstart demo shows the currently aligned pair.| Variable | Required | Description |
|---|---|---|
SPATIUS_API_KEY | Yes | Your Spatius API key |
SPATIUS_APP_ID | Yes | Your Spatius app ID |
SPATIUS_AVATAR_ID | Yes | Avatar to use |
SPATIUS_REGION | No | Region used to compose endpoints. Defaults to us-west; ap-northeast and cn-beijing are also supported. |
LIVEKIT_URL | Yes | Your LiveKit server URL |
LIVEKIT_API_KEY | Yes | LiveKit API key |
LIVEKIT_API_SECRET | Yes | LiveKit API secret |
Advanced: endpoint overrides
Advanced: endpoint overrides
For normal production use, set only
SPATIUS_REGION and the plugin composes the endpoints automatically. Leave it unset for us-west, or set it to ap-northeast or cn-beijing for another supported region. Set endpoint overrides only when proxying or testing against a staging environment.| Variable | Description |
|---|---|
SPATIUS_CONSOLE_ENDPOINT | Override Console API URL (default: https://console.<region>.spatius.ai/v1/console) |
SPATIUS_INGRESS_ENDPOINT | Override ingress WebSocket URL (default: wss://api.<region>.spatius.ai/v2/driveningress) |
Advanced: LiveKit egress room
Advanced: LiveKit egress room
By default, Motion Server publishes the avatar into the same LiveKit room as the agent. For specialized routing setups, pass Use this only when your LiveKit routing intentionally separates the agent room from the room where clients receive avatar audio and motion data. In the default LiveKit Agents Integration flow, leave
livekit_room_name to publish the avatar into a different room:livekit_room_name unset and connect the client to the same room as the agent.AvatarSession and start it with your agent session and room. livekit-plugins-spatius attaches to the pipeline and sends avatar speech audio to Spatius; Motion Server publishes the avatar’s audio and motion stream to the room.

