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

# Agora Convo AI Agent

> Configure Spatius as an avatar provider for Agora Convo AI.

## Prepare RTC tokens

Generate Agora RTC tokens on your backend with the App Certificate. Use a distinct UID and token for each participant:

| Token | Where it is used |
| - | - |
| Agent RTC token | Used by the Convo AI agent so it can join the Agora channel. |
| Avatar RTC token | `properties.avatar.params.agora_token` so Motion Server can publish avatar output into the same channel. |
| Client RTC token | Passed to the Web, iOS, or Android client so the user can join the same channel. |

<Warning>
  Use distinct Agora UIDs for the user, the Convo AI agent, and the Spatius avatar publisher. Do not reuse the avatar publisher UID as a client UID.
</Warning>

## Spatius avatar provider

Get the App ID and API Key from [Apps](https://app.spatius.ai/apps) (**Developer → API Key**) and the Avatar ID from the [Avatar Library](https://app.spatius.ai/avatars/library). Keep the API Key in the server-side agent configuration.

Add `properties.avatar` to the Convo AI agent configuration:

```json theme={null}
{
  "properties": {
    "channel": "room-a",
    "avatar": {
      "enable": true,
      "vendor": "spatius",
      "params": {
        "spatius_api_key": "${SPATIUS_API_KEY}",
        "spatius_app_id": "${SPATIUS_APP_ID}",
        "spatius_avatar_id": "${SPATIUS_AVATAR_ID}",
        "agora_uid": "77777",
        "agora_token": "avatar-rtc-token",
        "region": "us-west",
        "sample_rate": 24000,
        "session_expire_minutes": 30
      }
    }
  }
}
```

Replace the `${SPATIUS_*}` placeholders in your server code before submitting the request. The publisher token must match `agora_uid` and `properties.channel`; `sample_rate` must match the agent's TTS output. See [Regions](/api-reference/regions) and [Audio](/concepts/audio) for the optional region and audio settings.

After the start-agent request succeeds, return the Spatius App ID, Avatar ID, Agora App ID, channel, client UID, and client RTC token to your app. Never return the Spatius API Key or Agora App Certificate.

## Next steps

<CardGroup cols={2}>
  <Card title="Client" icon="globe" href="/agora-convoai/client" />

  <Card title="Audio" icon="waveform" href="/concepts/audio" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.