> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Simli Video Avatar

> SimliVideoService creates real-time Simli AI avatar video over WebRTC, animated by your Pipecat agent's audio.

## Overview

`SimliVideoService` integrates with Simli to create real-time AI avatar video experiences using WebRTC streaming. The service processes audio input to generate synchronized avatar video and audio output, handling real-time streaming, audio resampling, and conversation interruptions for engaging conversational AI applications.

> [card] [Simli Video API Reference](https://reference-server.pipecat.ai/en/latest/api/pipecat.services.simli.video.html)
>
> Pipecat's API methods for Simli video integration

> [card] [Example Implementation](https://github.com/pipecat-ai/pipecat/blob/main/examples/video-avatar/video-avatar-simli-video-service.py)
>
> Complete example with avatar streaming

> [card] [Simli Documentation](https://docs.simli.com/overview)
>
> Official Simli API documentation and guides

> [card] [Simli Platform](https://www.simli.com/)
>
> Access avatar faces and manage API keys

## Installation

To use Simli services, install the required dependency:

```bash theme={null}
uv add "pipecat-ai[simli]"
```

## Prerequisites

### Simli Account Setup

Before using Simli video services, you need:

1. **Simli Account**: Sign up at [Simli Platform](https://www.simli.com/)
2. **API Key**: Generate an API key from your account dashboard
3. **Face Selection**: Choose or create avatar faces for video generation
4. **WebRTC Setup**: Configure real-time streaming capabilities

### Required Environment Variables

* `SIMLI_API_KEY`: Your Simli API key for authentication
* `SIMLI_FACE_ID`: ID of your avatar face

## Configuration

**api\_key** `str` *required*

Simli API key for authentication.

**face\_id** `str` *required*

Simli Face ID. For Trinity avatars, specify `"faceId/emotionId"` to use a
different emotion than the default.

**simli\_url** `str` (default: [https://api.simli.ai](https://api.simli.ai))

URL of the Simli servers. Can be changed for custom deployments by enterprise
users.

**is\_trinity\_avatar** `bool` *deprecated* (default: None)

*Deprecated since 1.16.0, removed in 2.0.0.* No replacement; it has no effect.

**max\_session\_length** `int` (default: None)

Absolute maximum session duration in seconds. Avatar disconnects after this
time even if speaking.

**max\_idle\_time** `int` (default: None)

Maximum duration in seconds the avatar can be idle (not speaking) before
disconnecting.

**enable\_logging** `bool` (default: None)

Accepted but has no effect: the value is not passed to Simli.

**framing** `SimliFraming` (default: None)

Framing for Trinity-2 faces; other faces keep their own frame size. `None`
keeps Simli's defaults (768x768, avatar at the bottom center). Set the output
transport's `video_out_width` and `video_out_height` to match
`streaming_width` and `streaming_height`. See [Framing](#framing) below.

**settings** `SimliVideoSettings` (default: None)

Service settings. Use `SimliVideoService.Settings(...)` for configuration.

**params** `InputParams` (default: None)

> [!WARNING]
>
> **Deprecated since 0.0.106**: Use the direct constructor parameters
> (`max_session_length`, `max_idle_time`, `enable_logging`) or
> `settings=SimliVideoService.Settings(...)` instead.

Additional input parameters for session configuration. See
[InputParams](#inputparams) below.

### Framing

`SimliVideoService.Framing(...)` fields. A field left as `None` keeps Simli's
default.

| Parameter | Type | Default | Description |
| - | - | - | - |
| `streaming_width` | `int` | `None` | Video width in pixels, at least 512. With `streaming_height` it must make a 1:1, 16:9, or 9:16 frame, such as 1366x768. Default 768. |
| `streaming_height` | `int` | `None` | Video height in pixels, at least 512. Default 768. |
| `avatar_position_x` | `float` | `None` | Where the avatar sits across the video, from 0 (left) to 1 (right). Default 0.5. |
| `avatar_position_y` | `float` | `None` | Where the avatar sits down the video, from 0 (top) to 1 (bottom). Default 1. |
| `camera` | `SimliCamera` | `None` | Camera offsets the session starts with, set with `SimliVideoService.Camera(...)`. `None` keeps the avatar's own framing. |
| `background_id` | `str` | `None` | ID of a background uploaded to your Simli account, shown behind the avatar. |
| `foreground_id` | `str` | `None` | ID of a foreground uploaded to your Simli account, laid over the avatar. |

### InputParams

> [!WARNING]
>
> **Deprecated since 0.0.106**: Use the direct constructor parameters
> (`max_session_length`, `max_idle_time`, `enable_logging`) instead of
> `SimliVideoService.InputParams`.

| Parameter | Type | Default | Description |
| - | - | - | - |
| `enable_logging` | `bool` | `None` | Whether to enable Simli logging. |
| `max_session_length` | `int` | `None` | Absolute maximum session duration in seconds. Avatar disconnects after this time even if speaking. |
| `max_idle_time` | `int` | `None` | Maximum duration in seconds the avatar can be idle (not speaking) before disconnecting. |

## Usage

### Basic Setup

```python theme={null}
import os

from pipecat.services.simli.video import SimliVideoService

simli = SimliVideoService(
    api_key=os.getenv("SIMLI_API_KEY"),
    face_id=os.getenv("SIMLI_FACE_ID"),
)
```

### With Session Configuration

```python theme={null}
simli = SimliVideoService(
    api_key=os.getenv("SIMLI_API_KEY"),
    face_id=os.getenv("SIMLI_FACE_ID"),
    max_session_length=600,
    max_idle_time=120,
)
```

### Using Settings (Alternative)

```python theme={null}
simli = SimliVideoService(
    api_key=os.getenv("SIMLI_API_KEY"),
    face_id=os.getenv("SIMLI_FACE_ID"),
    settings=SimliVideoService.Settings(),
)
```

## Notes

* **Service architecture**: As of version 0.0.106, `SimliVideoService` extends `AIService` and supports `SimliVideoService.Settings(...)` for configuration, aligning it with other video services like HeyGen and Tavus.
* **Audio resampling**: The service resamples audio to 16kHz internally for the Simli API and resamples received audio back to the pipeline's sample rate.
* **Audio sources**: The avatar speaks `TTSAudioRawFrame` from a TTS service or `SpeechOutputAudioRawFrame` from speech-to-speech services that stream their voice, such as `OpenAILiveLLMService`. Audio goes to Simli as it arrives, and the avatar's voice is pushed as the same frame type.
* **Interruptions**: An `InterruptionFrame` clears Simli's buffer. A user speaking without interrupting the bot does not.
* **Deprecated parameters**:
  * `SimliVideoService.InputParams` is deprecated since 0.0.106. Use direct constructor parameters (`max_session_length`, `max_idle_time`, `enable_logging`) instead.
  * The `simli_config` and `use_turn_server` parameters have been removed. Use `api_key` and `face_id` directly as constructor parameters.


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