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

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

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


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

## Sample configuration

The following example shows how to configure Anam as the agent's avatar when you create or update an agent. For a complete example, see [Create an agent and start a session](/en/ai/platform/get-started/start-stop-agent#create-an-agent).

Anam supports BYOK only. It isn't available in managed mode. Store your Anam API key in a secret set, and refer to it from the agent. For details, see [Use your own provider keys](/en/ai/platform/build/use-your-own-keys).

**Python SDK**

```python
from agora_agent import Agent, AnamAvatar, secret_ref

# client is your configured Agora client
agent = (
    Agent(client=client)
    .with_stt(...)  # configure your ASR vendor
    .with_llm(...)  # configure your LLM vendor
    .with_tts(...)  # configure your TTS vendor
    .with_avatar(
        AnamAvatar(
            api_key=secret_ref("support_prod", "anam"),
            avatar_id="960f614f-ea88-47c3-9883-f02094f70874",
            additional_params={
                "agora_uid": "<avatar_rtc_uid>",
                "agora_token": "<avatar_rtc_token>",
                "sample_rate": 24000,
                "quality": "high",
                "video_encoding": "H264",
            },
        )
    )
)
```

**TypeScript SDK**

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

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(/* configure your ASR vendor */)
  .withLlm(/* configure your LLM vendor */)
  .withTts(/* configure your TTS vendor */)
  .withAvatar(
    new AnamAvatar({
      apiKey: secretRef('support_prod', 'anam'),
      avatarId: '960f614f-ea88-47c3-9883-f02094f70874',
      additionalParams: {
        agora_uid: '<avatar_rtc_uid>',
        agora_token: '<avatar_rtc_token>',
        sample_rate: 24000,
        quality: 'high',
        video_encoding: 'H264',
      },
    }),
  );
```

**Go SDK**

```go
// client is your configured Agora client
agent := agentkit.NewAgent(client).
	WithStt( /* configure your ASR vendor */ ).
	WithLlm( /* configure your LLM vendor */ ).
	WithTts( /* configure your TTS vendor */ ).
	WithAvatar(vendors.NewAnamAvatar(vendors.AnamAvatarOptions{
		APIKey:   agentkit.SecretRef("support_prod", "anam"),
		AvatarID: "960f614f-ea88-47c3-9883-f02094f70874",
		AdditionalParams: map[string]interface{}{
			"agora_uid":      "<avatar_rtc_uid>",
			"agora_token":    "<avatar_rtc_token>",
			"sample_rate":    24000,
			"quality":        "high",
			"video_encoding": "H264",
		},
	}))
```

**REST API**

Add an `avatar` block to the `pipeline`. Set `credential.mode` to `byok` and `credential.fields.api_key` to the reference. In the following example, the key is stored as `anam` in the `support_prod` set:

```json
"avatar": {
  "enabled": true,
  "credential": {
    "mode": "byok",
    "fields": {
      "api_key": "$secrets.support_prod.anam"
    }
  },
  "vendor": "anam",
  "params": {
    "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

The `avatar` block takes the following fields. In the SDKs, `AnamAvatar` sets them from its options, and passes any other parameters from its additional parameters option to `params`.

**avatar required**

**`enabled` (boolean) required**

Set to `true` to show the avatar.

**`vendor` (string) required**

Set to `anam`.

**`credential` (object) required**

Set `mode` to `byok` and `fields.api_key` to a `$secrets.<set>.<key>` reference to your Anam API key. Get your API key from the Anam console.

**`params` (object) required**

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

This integration is fully supported for use with the Conversational AI Platform. 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.
