Skip to main content
In Backend Mode Integration, your backend sends avatar speech audio to Motion Server, then delivers the response audio and returned motion data to each client.

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:
Open the URL printed by the script, initialize the Avatar, then send text or microphone input.

Build your backend

1

Install a Server SDK

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.
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.

Next steps

Client

Python Server SDK

Go Server SDK