# Akool (/en/ai/platform/models/avatar/akool)

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


Akool provides AI-powered avatars with realistic facial expressions and lip-sync capabilities, enabling natural video conversations with your AI agents. Their platform offers a variety of pre-built avatars and supports custom avatar creation.

## Sample configuration

The following example shows how to configure Akool 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).

Akool supports BYOK only. It isn't available in managed mode. Store your Akool 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, AkoolAvatar, 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 a TTS vendor with a 16,000 Hz sample rate
    .with_avatar(
        AkoolAvatar(
            api_key=secret_ref("support_prod", "akool"),
            avatar_id="<akool_avatar_id>",
            additional_params={
                "agora_uid": "<avatar_rtc_uid>",
                "agora_token": "<avatar_rtc_token>",
            },
        )
    )
)
```

**TypeScript SDK**

```ts
import { Agent, AkoolAvatar, 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 a TTS vendor with a 16,000 Hz sample rate */)
  .withAvatar(
    new AkoolAvatar({
      apiKey: secretRef('support_prod', 'akool'),
      avatarId: '<akool_avatar_id>',
      additionalParams: {
        agora_uid: '<avatar_rtc_uid>',
        agora_token: '<avatar_rtc_token>',
      },
    }),
  );
```

**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 a TTS vendor with a 16,000 Hz sample rate */ ).
	WithAvatar(vendors.NewAkoolAvatar(vendors.AkoolAvatarOptions{
		APIKey:   agentkit.SecretRef("support_prod", "akool"),
		AvatarID: "<akool_avatar_id>",
		AdditionalParams: map[string]interface{}{
			"agora_uid":   "<avatar_rtc_uid>",
			"agora_token": "<avatar_rtc_token>",
		},
	}))
```

**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 `akool` in the `support_prod` set:

```json
"avatar": {
  "enabled": true,
  "credential": {
    "mode": "byok",
    "fields": {
      "api_key": "$secrets.support_prod.akool"
    }
  },
  "vendor": "akool",
  "params": {
    "agora_uid": "<avatar_rtc_uid>",
    "agora_token": "<avatar_rtc_token>",
    "avatar_id": "<akool_avatar_id>"
  }
}
```

> **Info**
>
> Akool avatars only support audio with a sample rate of 16,000 Hz. Using a TTS model configured with a different sample rate results in an error. Make sure that your TTS configuration matches this requirement.

## Key parameters

The `avatar` block takes the following fields. In the SDKs, `AkoolAvatar` 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 `akool`.

**`credential` (object) required**

Set `mode` to `byok` and `fields.api_key` to a `$secrets.<set>.<key>` reference to your Akool API key.

> **Info**
>
> To purchase an Akool API key, contact [Agora sales](mailto:sales@agora.io).

**`params` (object) required**

**`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) optional**

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

**`avatar_id` (string) required**

The unique identifier for the specific Akool avatar you want to use. Find available avatar IDs in your Akool dashboard.

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.
