Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.spatius.ai/llms.txt

Use this file to discover all available pages before exploring further.

What is Backend Mode Integration?

Backend Mode Integration is a Standalone Integration centered on the Spatius Server SDK: your backend connects to Motion Server, sends avatar speech audio, receives encoded audio and motion messages, then delivers those messages to AvatarKit clients. Use this path when your backend owns ASR, LLM, TTS, turn-taking, provider keys, and the connection to Motion Server.

Core backend flow

The Server SDK is the required piece in this path. The client does not connect to Motion Server directly, and it usually does not hold a Spatius Session Token. Instead, the client receives encoded messages from your backend and feeds them into AvatarKit with yieldAudioData() and yieldFramesData().

SDK roles

SDK surfaceRuns inWhat it does
Server SDKYour backendAuthenticates with Spatius, connects to Motion Server, sends avatar speech audio, and receives encoded messages.
Client SDKWeb, iOS, Android, or Flutter clientReceives encoded messages from your backend and renders them locally.

Requirements

RequirementWhy it matters
Spatius Server SDKRequired. Your backend uses it to authenticate, connect to Motion Server, and generate encoded messages for clients.
API KeyStored only on your backend. Used by the Server SDK, never by client apps.
App ID and Avatar IDIdentify the app and avatar your clients render.
Downstream transportYour backend must deliver encoded audio and motion messages to clients. This can be your own WebSocket, LiveKit, or another supported transport.

Transport options

Transport is a second decision inside Backend Mode Integration. LiveKit is optional.
TransportUse whenGuide
Your own WebSocketYou want the simplest Backend Mode shape: your backend relays encoded audio and motion messages directly to clients. This is the reference demo path.Your own transport
LiveKit as downstream transportYou already want LiveKit between your backend and clients, but you are not using LiveKit Agents as the agent framework.Backend Mode with LiveKit
Agora RoomOn the Spatius roadmap.Not documented yet.
Backend Mode does not require LiveKit. The required integration point is the Spatius Server SDK on your backend. LiveKit is only one downstream transport option after your backend receives messages from Motion Server.

Architecture variants

Your own transport

Your backend receives encoded messages from the Spatius Server SDK and relays them to clients over your own WebSocket or network layer.

Third-party realtime transport

Your backend still uses the Spatius Server SDK. The RTC provider only carries the downstream audio and motion messages between your backend and your clients.

Next steps

Server SDK role

Backend SDK responsibility and language references.

Client SDK role

Client-side rendering responsibility.

Browse all demos

Run reference implementations for Web, iOS, Android, and Flutter.

Your own transport

Direct WebSocket relay between your backend and clients.