# Anam (/en/ai/models/avatar/anam)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI.
> Documentation version: Main.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-guides-v1.txt).


Anam provides AI-powered avatars with real-time video rendering, enabling natural video conversations with your AI agents.

### Sample configuration

The following examples show how to configure an Anam avatar when starting a conversational AI agent.

**Python SDK**

```python
from agora_agent import Agent
from agora_agent.agentkit.vendors import AnamAvatar

# client is your configured Agora client
agent = (
    Agent(client)
    .with_stt(...)  # configure your STT vendor
    .with_llm(...)  # configure your LLM vendor
    .with_tts(...)  # configure your TTS vendor
    .with_avatar(AnamAvatar(
        api_key='your-anam-key',
        avatar_id='<anam_avatar_id>',
    ))
)
```

**TypeScript SDK**

```typescript
import { Agent, AnamAvatar } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(/* configure your STT vendor */)
  .withLlm(/* configure your LLM vendor */)
  .withTts(/* configure your TTS vendor */)
  .withAvatar(new AnamAvatar({
    apiKey: 'your-anam-key',
    avatarId: '<anam_avatar_id>',
  }));
```

**Go SDK**

```go
import (
    "github.com/AgoraIO/agora-agents-go/v2/agentkit"
    "github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)

// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
  WithLlm(/* configure your LLM vendor */).
  WithTts(/* configure your TTS vendor */).
  WithAvatar(
    vendors.NewAnamAvatar(vendors.AnamAvatarOptions{
        APIKey:   "your-anam-key",
        AvatarID: "<anam_avatar_id>",
    }),
)
```

**REST API**

Use the following `avatar` configuration in your request:

```json
"avatar": {
  "vendor": "anam",
  "enable": true,
  "params": {
    "api_key": "<anam_key>",
    "avatar_id": "960f614f-ea88-47c3-9883-f02094f70874",
    "agora_uid": "<avatar_rtc_uid>",
    "agora_token": "<avatar_rtc_token>",
    "sample_rate": 24000,
    "quality": "high",
    "video_encoding": "H264"
  }
}
```

### Key parameters

**params required**

**`api_key` (string) required**

The API key used for authentication with Anam's services. Get your API key from the Anam console.

**`avatar_id` (string) required**

The unique identifier for the Anam avatar you want to use.

**`agora_uid` (string) required**

The unique identifier for the avatar's RTC connection. This must be different from other participants in the channel.

**`agora_token` (string) required**

The RTC token that authorizes the avatar to join the video channel. Generate this token using your Agora project credentials.

**`sample_rate` (number) optional**

Default value: `24000`

Possible values: `16000, 24000, 48000`

The audio sample rate in Hz.

**`quality` (string) optional**

Default value: `high`

Possible values: `high, medium, low`

The video quality level.

**`video_encoding` (string) optional**

Default value: `H264`

Possible values: `H264, AV1`

The video encoding format.

**`avatar_model` (string) optional**

The Anam avatar model. For example, `cara-4` for Cara 4. If not set, Anam selects the model based on `avatar_id`.

**`video_width` (number) optional**

The output video width in pixels. Set together with `video_height`. For supported resolutions, see [Portrait video](#portrait-video).

**`video_height` (number) optional**

The output video height in pixels. Set together with `video_width`. For supported resolutions, see [Portrait video](#portrait-video).

> **Caution**
>
> The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to Anam without validation. For a full list of supported options, refer to the [Anam documentation](https://docs.anam.ai/).

### Portrait video

For mobile apps, configure portrait video as follows:

1. Set `avatar_model` to `cara-4`.
2. Set `video_width` and `video_height` to a portrait resolution, such as 768 x 1152.

The following resolutions are supported:

| Resolution (width x height) | Orientation | Model  |
| --------------------------- | ----------- | ------ |
| 720 x 480                   | Landscape   | Cara 3 |
| 1152 x 768                  | Landscape   | Cara 4 |
| 768 x 1152                  | Portrait    | Cara 4 |

Set `video_width` and `video_height` together, or omit both to use the default resolution of the avatar model.

**Python SDK**

```python
AnamAvatar(
    api_key='your-anam-key',
    avatar_id='<anam_avatar_id>',
    avatar_model='cara-4',
    video_width=768,
    video_height=1152,
)
```

**TypeScript SDK**

```typescript
new AnamAvatar({
  apiKey: 'your-anam-key',
  avatarId: '<anam_avatar_id>',
  avatarModel: 'cara-4',
  videoWidth: 768,
  videoHeight: 1152,
});
```

**Go SDK**

```go
width, height := 768, 1152

vendors.NewAnamAvatar(vendors.AnamAvatarOptions{
    APIKey:      "your-anam-key",
    AvatarID:    "<anam_avatar_id>",
    AvatarModel: "cara-4",
    VideoWidth:  &width,
    VideoHeight: &height,
})
```

**REST API**

```json
"avatar": {
  "vendor": "anam",
  "enable": true,
  "params": {
    "api_key": "<anam_key>",
    "avatar_id": "<anam_avatar_id>",
    "agora_uid": "<avatar_rtc_uid>",
    "agora_token": "<avatar_rtc_token>",
    "avatar_model": "cara-4",
    "video_width": 768,
    "video_height": 1152
  }
}
```

This integration is fully supported for use with Conversational AI Engine. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
