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.

GitHub Repository

SwiftUI sample implementing the avatar pipeline: VAD → ASR → LLM → TTS → AvatarKit.
This quickstart targets the Direct Mode path on iOS. The sample app pastes the Session Token in the UI rather than fetching from a backend — convenient for first-run validation.

Prerequisites

  • Xcode 16+
  • iOS 16+ device or simulator (real device recommended for mic input)
  • Spatius credentials. See Credentials.
  • An OpenAI API key for the ASR + LLM + TTS pipeline used by the sample.

Run it

1

Clone and open the sample

git clone https://github.com/spatius-ai/spatius-avatar-demo.git
cd spatius-avatar-demo/direct-mode/clients/ios
brew install xcodegen
Generate and open the Xcode project:
xcodegen generate
open AvatarDemo.xcodeproj
2

Configure credentials

Edit AvatarDemo/Config.swift:
appID = "<your-app-id>"
avatarID = "<your-avatar-id>"
openAIApiKey = "<your-openai-api-key>"
Session Token is not stored in Config.swift — paste it in the app UI at runtime.
3

Build and run

Use Xcode to build and run on a connected iOS device or simulator. The AvatarKit.xcframework is downloaded automatically on first build from the configured release.
4

Start a conversation

In the running app:
  1. Paste your Session Token.
  2. Tap Start Conversation.
  3. Speak and pause. The avatar should respond with lip-synced speech.

What this validates

CheckWhat it tells you
Avatar rendersApp ID + Avatar ID are correct, framework is correctly embedded.
Conversation startsSession Token is valid, Motion Server connection works.
Avatar speaksFull pipeline (mic → ASR → LLM → TTS → AvatarKit) is wired up end to end.

Next steps

iOS SDK reference

Complete iOS API documentation.

Browse all demos

Web (multi-framework) and Android samples in addition to iOS.