DOCS
Integration guide
Embed an AI avatar on your site in three ways — as little as two lines of code. Full parameters and error codes live in the console.
Three steps to integrate
Sign in to the console, create an avatar with your chosen look and voice, get an Agent ID.
A default key is generated automatically; create separate keys per site with allowed-origin whitelists.
Grab the full snippet from the console's Integration page, replace placeholders, and ship.
Which method to pick
Same avatar capabilities; choose the path that fits your stack.
| Method | Best for | Control | Style isolation |
|---|---|---|---|
| JS SDK | SPAs needing event subscriptions and programmatic control | ★★★ | Medium |
| Web Component | Vue / React / vanilla HTML, minimal setup | ★★ | High (Shadow DOM) |
| iframe | Static sites, CMS, articles, zero deps | ★ | Highest (sandbox) |
Pick your integration route
Decided by what your LLM returns — text only takes route A, audio comes with route B.
Your LLM returns text — we handle TTS + lip-sync
Send us plain text. We synthesize the voice and drive the avatar's mouth. The fastest path — three lines of real code and you are live.
Recommended for first integration
Your LLM returns text + audio — we only lip-sync
Bring your own TTS so you fully own the voice — celebrity IP, brand voice, dialects. We just align the lip motion.
For brand-owned voice
Start with A. Switching to B later does not change the architecture — same widget instance, different API call.
Quickest start · SDK example
Copy the snippet, swap agent_xxx and YOUR_API_KEY for your own — done.
<script type="module" src="https://embed.avataraisdk.com/sdk.js"></script>
<script type="module">
const widget = AIAvatar.init({
agentId: 'agent_xxxxxxxxxxxx',
apiKey: 'YOUR_API_KEY',
behavior: { llmMode: 'external' },
// Route A: your LLM returns text, we do TTS + lip-sync
onUserInput: async (msg) => {
const reply = await myCustomerLLM(msg.content);
widget.replyText(reply);
},
});
</script>JS SDK / Web Component snippets, parameter reference, error codes, and origin whitelist setup all live in the console.
View the full integration docs
Sign in to the console → Integration: get your API key, every code sample, parameter reference, and error-handling tips.
Open console