Before you start
Get the App ID and API Key from Apps (Developer → API Key) and the Avatar ID from the Avatar Library. Keep the API Key on your backend. The App ID and Avatar ID must match the values used by the client.Run the Python reference implementation
The Backend Mode demo contains a complete Python backend and Web, iOS, Android, and Flutter clients:Build your backend
1
Install a Server SDK
- Python
- Go
2
Create and start an Avatar session
Configure the session with the API Key, App ID, Avatar ID, region, audio format, and a motion data callback. Then initialize the session and open its Motion Server connection.
- Python
- Go
3
Deliver one response turn
Assign the response a turn ID. Send its audio to the client first, then send the same audio to Spatius. Forward every motion data payload from the Server SDK callback to the client with that turn ID. Keep response turns serial unless your delivery layer can route overlapping callbacks correctly.Your application transport can be WebSocket or HTTP streaming. It must preserve message order and the turn ID. See the complete Python implementation or the Go SDK lifecycle.
4
Cancel or close
Stop forwarding a discarded turn when the conversation is cancelled, and close the Avatar session when the client leaves. Exact lifecycle APIs are listed in the Server SDK Reference.

