Add a MeshLite avatar to your site
The avatar runs in an iframe served by MeshLite and is rendered in your visitor’s browser. Your page loads one script, your server issues short-lived session tokens, and voice and AI come from your own provider account.
No code to write? Create a project
In the Console, open Projects, click New project, enter your site’s address and choose an avatar. The project shows a code to paste once before </body>, or a prompt for your AI assistant (ChatGPT, Claude, Cursor, Lovable, Bolt). The code has no secret key and needs no server or API key. It works only on your site, with its www address. The Console shows where to paste it in WordPress, Shopify, Wix, Webflow and Squarespace. The project changes to Online when a page of your site shows the avatar. Add or remove avatars later without changing the code.
The rest of this page is the developer integration: your own server, your own buttons and full control of the session. Building a voice agent with LiveKit or Pipecat? Go straight to the LiveKit guide or the Pipecat guide. Using ElevenLabs Agents? See the ElevenLabs Agents guide.
Using an AI coding agent?
Paste this prompt into Claude Code, Codex, Cursor or another coding agent. It follows our integration guide for agents, writes the server route and the page code, and tells you what to set up in the Console. Your secret key stays out of the chat: you add it to your .env file yourself.
Add a MeshLite talking avatar to this website. Follow the guide at https://meshlite.io/llms.txt (if you can't open it, ask me to paste it). Ask me for my MeshLite publishable key and, optionally, an avatar ID. Never ask me to paste my secret key: put a placeholder in .env and I'll add it myself. If I don't have a MeshLite account, send me to https://console.meshlite.io/console?plan=free#signup first.Agent without web access? Copy the full guide and paste it into the conversation.
Create your workspace
Sign up in the Console: free, no card, activated from the email we send. The Free plan can go live on one site (a domain with its www address and subdomains), with the default avatars, the MeshLite watermark on the avatar and up to 3 simultaneous conversations; the avatar speaks through your own voice provider. Removing the watermark needs a paid plan.
Connect your voice and AI
The developer settings are in Projects, under For developers (tabs Keys, Allowed sites and Code). Voice services and personalities have their own menus.
- Allowed sites: add every origin that will show the avatar, exactly as the browser sees it, port included:
http://localhost:3000for local development,https://for anything else. - Keys: create a publishable key and a secret key in the same environment. Test keys (
ml_pk_test_…) work with test domains; live keys with live domains. On a public page, a test key shows a MeshLite label on the avatar. - Services (in the menu): connect your voice provider with your own key: OpenAI, Azure OpenAI Realtime, Azure AI Speech or ElevenLabs. Every account also gets 10 minutes of MeshLite voice a day, shared by your site and the Console, to help while you set up; after that, the avatar speaks through your provider.
- Library, tab Personalities: write what the avatar knows and how it speaks, publish it, then pick it on your avatar in the Avatars menu.
- Code: copy your avatar ID. This tab also shows the code below with your own values filled in.
Then add them to your server’s environment. The secret key never goes in browser code or Git.
MESHLITE_SECRET_KEY=ml_sk_test_...
MESHLITE_PUBLISHABLE_KEY=ml_pk_test_...
MESHLITE_ORIGIN=http://localhost:3000
MESHLITE_AVATAR=Add the SDK to your site
Issue session tokens from your server
Your server keeps the secret key and asks MeshLite for a session token. Call this from a POST /api/meshlite-session route and return { sessionToken }. Tokens last 2 minutes; the SDK asks for a new one when it needs it. Node.js 18+, no dependency:
export async function createMeshLiteSession() {
const response = await fetch("https://console.meshlite.io/api/v1/client-sessions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MESHLITE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
publishableKey: process.env.MESHLITE_PUBLISHABLE_KEY,
origin: process.env.MESHLITE_ORIGIN, // from your config, never from the request
avatar: process.env.MESHLITE_AVATAR || undefined,
conversation: { language: "en", responseStyle: "concise", idleTimeout: 30 },
}),
});
const body = await response.json();
if (!response.ok) throw new Error(`MeshLite ${body.error?.code}: ${body.error?.message}`);
return body.sessionToken;
}The route is public: rate-limit it, or put it behind your own sign-in if only signed-in users should talk to the avatar.
Mount the avatar in your page
The iframe takes the size of its container. Browsers only open the microphone after a click, so start the conversation from one.
<div id="avatar" style="width:340px;height:510px"></div>
<button id="talk">Talk to the avatar</button>
<script src="https://console.meshlite.io/sdk/1.11.52/meshlite.js" crossorigin="anonymous"></script>
<script>
const avatar = MeshLite.mount({
container: "#avatar",
avatar: "YOUR_AVATAR_ID", // same as MESHLITE_AVATAR; remove for the default avatar
locale: "en",
publishableKey: "ml_pk_test_...", // safe to expose
sessionToken: async () => {
const response = await fetch("/api/meshlite-session", { method: "POST" });
if (!response.ok) throw new Error("Could not start the avatar session");
return (await response.json()).sessionToken;
},
conversation: { language: "en", responseStyle: "concise", idleTimeout: 30 },
captions: "overlay",
});
avatar.on("error", (message, detail) => console.error("MeshLite", detail.code, message));
document.getElementById("talk").addEventListener("click", () => avatar.startConversation());
</script>React, Next.js, Vue: load the script once, mount in a client-side effect (useEffect, onMounted) and call avatar.unmount() in its cleanup. There is no npm package: load the SDK from console.meshlite.io only.
Going live
In Projects, under For developers, open Allowed sites and add your production domain as a live domain (HTTPS), create live keys and replace the test values in your environment. No code change is needed. The Free plan goes live on one site with the MeshLite watermark; paid plans add custom avatars, and from Creator up they also remove the watermark and allow more simultaneous conversations (Lite keeps a MeshLite attribution).
Guide: a LiveKit voice agent with a MeshLite face
You will run a complete demo on your computer: a voice agent built with LiveKit Agents talks to a visitor in a web page, and a MeshLite avatar moves its lips in sync. Your agent keeps its own brain and voice (speech-to-text, language model, voice, or a realtime model). MeshLite only draws the face, on the visitor’s own phone or computer. Count about 10 minutes.
How it works: the agent sends its voice to the page over the LiveKit data channel, and the MeshLite SDK in the page plays it in sync with the face. There is no video server, no GPU and no extra participant in the room. No MeshLite voice minutes are used. The session still counts as a conversation (simultaneous conversations and statistics) and lasts at most 2 hours.
What you need
- A MeshLite account on a plan that can show the avatar on a website (the Free plan works: one site, with the MeshLite watermark).
- A LiveKit project: a free LiveKit Cloud project, or a local
livekit-server. - An OpenAI API key for the example agent (you can swap in any other model later).
- Python 3.9 or later, Git, and a recent browser with a microphone.
1. Prepare the Console
In Projects, under For developers:
- Allowed sites: add
http://localhost:8080as a test site. - Keys: create a test publishable key (
ml_pk_test_…) and a test secret key (ml_sk_test_…). Keep the secret key out of Git and chats. - Code: copy your avatar ID.
2. Get the example
git clone https://github.com/meshlite-avatar/livekit-plugins-meshlite
cd livekit-plugins-meshlite/examples/browser-avatar
cp .env.example .env # Windows: copy .env.example .envOpen .env and fill in the settings:
LIVEKIT_URL,LIVEKIT_API_KEY,LIVEKIT_API_SECRET: from your LiveKit Cloud project (Settings, API keys). With a local server, usews://localhost:7880,devkeyandsecret: the launcher then startslivekit-server --devfor you.OPENAI_API_KEY: your OpenAI key. With Azure OpenAI instead, uncomment the threeAZURE_OPENAI_*lines in.env(endpoint, key and the name of your realtime deployment) and leaveOPENAI_API_KEYempty.MESHLITE_PUBLISHABLE_KEYandMESHLITE_SECRET_KEY: the two test keys from step 1.MESHLITE_AVATAR: your avatar ID.PUBLIC_ORIGIN: leavehttp://localhost:8080, the test site you added in step 1. It is the address of the demo page; changePORTas well if 8080 is taken.
3. Start everything with one command
python run.pyThe launcher works on Windows, macOS and Linux. It creates a virtual environment and installs the dependencies (first run only, one or two minutes), checks .env and names anything missing without ever printing a value, starts the agent and the web server with prefixed logs, waits for the agent to connect to LiveKit, opens the page, and stops everything on Ctrl+C. You should see:
[run] Waiting for the agent to connect to LiveKit ...
[agent] registered worker
[run] The agent is connected to LiveKit and waits for a visitor.
[run] Ready: http://localhost:8080
[run] Press Start in the page and allow the microphone. Press Ctrl+C here to stop everything.If something is missing, run python run.py --check: it lists each missing or wrong setting and exits.
4. Talk to your avatar
In the page, press Start and allow the microphone. The status goes from “Connecting…” to “Avatar ready”, then the face greets you and answers with matching lips. Interrupt it by speaking: it stops at once, and the agent keeps only what you actually heard. On Chrome, Edge and Safari the voice plays in the avatar frame; on Firefox the page plays the voice itself and the avatar moves its lips in silence, so that Firefox’s echo cancellation can hear it.
Phones work too: once your page is served over HTTPS (step 6), the avatar runs in Chrome on iPhone and Android.
5. Use it in your own agent and page
Everything the example does comes down to three pieces. On the agent side (Python, livekit-agents 1.x):
pip install livekit-plugins-meshlitefrom livekit.agents import Agent, AgentSession, JobContext
from livekit.plugins import meshlite
async def entrypoint(ctx: JobContext):
await ctx.connect()
session = AgentSession(
# stt=..., llm=..., tts=... or a realtime model
resume_false_interruption=False,
)
avatar = meshlite.AvatarSession()
await avatar.start(session, room=ctx.room) # after ctx.connect(), before session.start()
await session.start(agent=Agent(instructions="..."), room=ctx.room)The agent then publishes no audio track: its voice reaches the page as data. If your agent version offers false-interruption resume, keep it off, as above: a speech segment cannot be paused and resumed.
On your server, create the MeshLite session as in Issue session tokens from your server, with audio: "livekit" added to the body, and create the visitor’s LiveKit participant token in the same route. The secret key stays on the server:
body: JSON.stringify({
publishableKey: process.env.MESHLITE_PUBLISHABLE_KEY,
origin: process.env.MESHLITE_ORIGIN, // from your config, never from the request
avatar: process.env.MESHLITE_AVATAR,
audio: "livekit",
}),In the page, mount the avatar with audio: "livekit" and attach the room before connecting, so no speech is missed. Do not subscribe to the agent’s audio yourself: the SDK plays the voice. This needs livekit-client 2.9 or later and the MeshLite SDK 1.11.45 or later:
<div id="avatar" style="width:340px;height:510px"></div>
<button id="start">Start</button>
<script src="https://console.meshlite.io/sdk/1.11.52/meshlite.js" crossorigin="anonymous"></script>
<script type="module">
import { Room } from "https://cdn.jsdelivr.net/npm/livekit-client@2.23.0/+esm";
document.getElementById("start").addEventListener("click", async () => {
// Your server returns sessionToken, livekitUrl and participantToken.
const s = await (await fetch("/api/session", { method: "POST" })).json();
const avatar = MeshLite.mount({
container: "#avatar",
avatar: s.avatar,
publishableKey: s.publishableKey,
sessionToken: s.sessionToken,
audio: "livekit",
});
const room = new Room();
const link = avatar.attachLiveKit(room); // before room.connect
link.on("ready", ({ output }) => console.log("avatar ready, voice played by", output));
link.on("fallback", ({ code }) => console.warn("avatar unavailable, the voice continues", code));
link.on("audio-blocked", () => showEnableSoundButton(() => link.resumeAudio()));
await room.connect(s.livekitUrl, s.participantToken);
await room.localParticipant.setMicrophoneEnabled(true);
});
</script>The avatar never blocks the conversation. If the face cannot start or stops (refused session, network, maximum duration), the page plays the agent’s voice itself from the position already heard, and link emits fallback with an error code. Pass fallback: false to attachLiveKit if you prefer it to stop. The plugin repository lists every option.
6. Go to production
- In Allowed sites, add your production domain as a live site (HTTPS), create live keys, and put them in your server’s environment with
PUBLIC_ORIGINset to the HTTPS address. The browser needs HTTPS in production; onlyhttp://localhostworks over plain HTTP, with test keys. - Protect
/api/session: it creates a conversation. Sign visitors in or rate-limit the route, as noted in Issue session tokens from your server. - Run the agent as a LiveKit worker (LiveKit Cloud or your own deployment) with
python agent.py start, not on a laptop. - Keep
MESHLITE_SECRET_KEYand the LiveKit secret in your server’s secret store, never in the page or in Git.
If something does not work
- Missing or wrong settings:
python run.py --checknames each one. A test key paired with a live key, or swapped publishable and secret keys, is reported by name. ORIGIN_NOT_ALLOWED: the page address, port included, is not in Allowed sites for the keys’ environment. Addhttp://localhost:8080(or yourPORT) as a test site.ENVIRONMENT_MISMATCH: the publishable key, secret key, avatar and site must all be test, or all live.- No voice in the page: browsers only play sound after a click. If an Enable sound button appears, click it (your page does this with
link.resumeAudio()on theaudio-blockedevent). On Firefox the sound comes from the page by design, so check that the tab is not muted. - The microphone does not start: allow it in the browser’s address bar. It opens only after a click, and only on HTTPS or
http://localhost. - The avatar shows but the agent stays silent: check that the log says
registered worker, thatOPENAI_API_KEY(or theAZURE_OPENAI_*settings) is valid, and read the[agent]lines for errors. An Azure message aboutVirtual Network/Firewall rulesmeans your Azure resource does not allow the machine that runs the agent. - Port already in use: change
PORTandPUBLIC_ORIGINin.env, and add the new address in Allowed sites.
Guide: a Pipecat bot with a MeshLite face
You will run a complete demo on your computer: a voice bot built with Pipecat talks to a visitor in a web page, and a MeshLite avatar moves its lips in sync. Your bot keeps its own speech-to-text, language model, voice and transport. MeshLite only draws the face, in the visitor’s browser. The guide uses pipecat-meshlite, our community integration that works with Pipecat (on PyPI). Count about 10 minutes.
How it works: in the bot, MeshLiteAvatarProcessor creates the MeshLite session with your secret key when the page asks for it, and tells the page when the bot changes language. It never changes, delays or copies the bot’s audio. In the page, the MeshLite SDK takes the bot’s voice from the WebRTC audio track the page already receives, follows Pipecat’s speaking and interruption events, and animates the face in the browser. No extra participant, no video server and no GPU. No MeshLite voice minutes are used. The session still counts as a conversation (simultaneous conversations and statistics) and lasts at most 2 hours.
What you need
- A MeshLite account on a plan that can show the avatar on a website (the Free plan works: one site, with the MeshLite watermark).
- For the example bot: an Azure AI Services resource with Speech and an Azure OpenAI chat deployment. You can swap in any other Pipecat services later: the processor does not depend on them.
- Python 3.11 or later, uv, Git, and a recent browser with a microphone. No LiveKit, Daily or other media server: the page and the bot talk directly over WebRTC.
1. Prepare the Console
In Projects, under For developers:
- Allowed sites: add
http://localhost:7860as a test site. - Keys: create a test publishable key (
ml_pk_test_…) and a test secret key (ml_sk_test_…). Keep the secret key out of Git and chats. - Code: copy your avatar ID.
2. Get the example
git clone https://github.com/meshlite-avatar/pipecat-meshlite
cd pipecat-meshlite
uv sync --extra example
cp examples/env.example examples/.env # Windows: copy examples\env.example examples\.envOpen examples/.env and fill in the settings:
AZURE_API_KEYandAZURE_REGION: the key and region of your Azure AI Services resource.AZURE_OPENAI_ENDPOINTandAZURE_OPENAI_MODEL: its Azure OpenAI address and the name of your chat deployment.MESHLITE_PUBLISHABLE_KEYandMESHLITE_SECRET_KEY: the two test keys from step 1.MESHLITE_AVATAR: your avatar ID. The page and the session use the same avatar.MESHLITE_ORIGIN: leavehttp://localhost:7860, the test site you added in step 1.
3. Start the bot
uv run examples/bot.pyThe bot is one file: Azure speech-to-text, Azure OpenAI and Azure text-to-speech over SmallWebRTC, with the face page served at /. When the log shows this line, open http://localhost:7860:
INFO: Uvicorn running on http://localhost:7860 (Press CTRL+C to quit)4. Talk to your avatar
In the page, press Start and allow the microphone. The status goes from “Connecting...” to “Avatar ready”, then the face greets you and answers with matching lips. Interrupt it by speaking: it stops at once, and the rest of the cut answer is not replayed. On Chrome, Edge and Safari the voice plays in the avatar frame; on Firefox the page plays the voice itself and the avatar moves its lips in silence, so that Firefox’s echo cancellation can hear it. Until the face is ready, the page plays the voice itself.
5. Add the face to your own bot and page
Install the package on your bot’s server:
uv add pipecat-meshlite # or: pip install pipecat-meshliteIn the bot, put MeshLiteAvatarProcessor after the TTS service. It reads MESHLITE_PUBLISHABLE_KEY, MESHLITE_SECRET_KEY, MESHLITE_ORIGIN (the address of your page) and MESHLITE_AVATAR from the server’s environment; the secret key never reaches the page. Keep RTVI on (the default of PipelineWorker):
from pipecat.pipeline.pipeline import Pipeline
from pipecat.transcriptions.language import Language
from pipecat_meshlite import MeshLiteAvatarProcessor
avatar = MeshLiteAvatarProcessor(language=Language.EN) # reads MESHLITE_* from the environment
pipeline = Pipeline([
transport.input(),
stt,
user_aggregator,
llm,
tts,
avatar, # after the TTS: it reads what the bot says
transport.output(),
assistant_aggregator,
])- Lip language: the processor reads the words the bot speaks. When a reply is clearly in English, French or Mandarin Chinese and differs from the current lip model, it sends
meshlite-languageand the page switches the lips. Other languages useauto. The lips follow the bot’s voice, not the visitor’s speech-to-text. A bot that switches language on purpose can callawait avatar.set_language("fr"). - Sessions:
max_sessions(default 3) limits the session requests one connection can send to MeshLite, refusals included. Each session counts as a conversation. - Events:
on_session_createdandon_session_errorlet your bot log or react. The package README lists every parameter.
In the page, mount the avatar with audio: "track", let it ask the bot for its session, and attach the Pipecat client before connecting, so no speech is missed. Keep your usual bot audio element: the SDK mutes it while the face plays the voice and unmutes it whenever the face cannot, so the visitor hears the bot exactly once. This needs @pipecat-ai/client-js 1.x and the MeshLite SDK 1.11.48 or later (tested with 1.11.60):
<div id="avatar" style="width:340px;height:510px"></div>
<button id="start">Start</button>
<audio id="bot-audio" autoplay></audio>
<script src="https://console.meshlite.io/sdk/1.11.60/meshlite.js" crossorigin="anonymous"></script>
<script type="module">
import { PipecatClient } from "https://cdn.jsdelivr.net/npm/@pipecat-ai/client-js@1.16.0/+esm";
import { SmallWebRTCTransport } from "https://cdn.jsdelivr.net/npm/@pipecat-ai/small-webrtc-transport@1.11.2/+esm";
document.getElementById("start").addEventListener("click", async () => {
let botReady;
const ready = new Promise((resolve) => { botReady = resolve; });
const client = new PipecatClient({
transport: new SmallWebRTCTransport(),
enableMic: true,
callbacks: {
onBotReady: () => botReady(),
onTrackStarted: (track, participant) => { // your usual bot audio element
if (track.kind === "audio" && !participant?.local) {
document.getElementById("bot-audio").srcObject = new MediaStream([track]);
}
},
// The bot changed language: the lips follow.
onServerMessage: (m) => { if (m?.type === "meshlite-language") avatar.setLanguage(m.language); },
},
});
const avatar = MeshLite.mount({
container: "#avatar",
avatar: "your-avatar-id", // the same avatar as MESHLITE_AVATAR
publishableKey: "ml_pk_test_…",
audio: "track",
// The bot creates the session. Stays under the SDK's 15 s wait: 4 s for the bot, then 10 s.
sessionToken: async () => {
await Promise.race([ready, new Promise((_, fail) => setTimeout(() => fail(new Error("bot not ready")), 4000))]);
try {
const reply = await client.sendClientRequest("meshlite-session", {}, 10000);
return (reply?.d ?? reply).sessionToken;
} catch (e) {
const error = e?.data?.error ?? e?.message ?? String(e);
// A refusal or the session limit will not change: the SDK must not ask again.
throw Object.assign(new Error(error), { retryable: !/^meshlite_session_(refused|limit)/.test(error) });
}
},
});
const link = avatar.attachPipecat(client); // before client.connect
link.on("ready", ({ output }) => console.log("avatar ready, voice played by", output));
link.on("fallback", ({ code }) => console.warn("avatar unavailable, the voice continues", code));
link.on("audio-blocked", () => showEnableSoundButton(() => link.resumeAudio()));
await client.connect({ webrtcUrl: "/api/offer" }); // your usual Pipecat connection
});
</script>The avatar never blocks the conversation. If MeshLite refuses the session, the page gets meshlite_session_refused:<code> (final) or meshlite_session_unavailable:<code> (worth another try), the bot keeps talking, and link emits fallback. The same happens if the face stops (network, maximum duration): your page keeps playing the bot’s voice. Prefer to give the page its session over HTTP? MeshLiteClient in the same package creates it for any route; the README shows how. Another WebRTC voice agent without Pipecat? Mount with audio: "track" and call avatar.attachAudioTrack(track) with the agent’s audio track; the full guide lists its options and events.
6. Go to production
- In Allowed sites, add your production domain as a live site (HTTPS), create live keys, and put them in your server’s environment with
MESHLITE_ORIGINset to the HTTPS address of your page. - Protect
/api/offer: each connection starts a bot, and each bot can create MeshLite sessions. Sign visitors in or rate-limit the route. - SmallWebRTC connects the browser straight to your server. Behind a firewall or NAT, add a STUN or TURN server, or use Daily or another Pipecat transport:
attachPipecatworks the same with all of them.pipecat-meshliteis tested with SmallWebRTC and only uses RTVI messages. - Keep
MESHLITE_SECRET_KEYand your model keys in your server’s secret store, never in the page or in Git.
If something does not work
- Missing or wrong settings: compare
examples/.envwithexamples/env.example, and read the bot log for the setting it names. meshlite_session_refusedwithORIGIN_NOT_ALLOWEDorENVIRONMENT_MISMATCH: addhttp://localhost:7860(or the port you use) as a test site, and keep the keys, avatar and site all test or all live.- No voice in the page: browsers only play sound after a click. If an Enable sound button appears, click it (your page does this with
link.resumeAudio()on theaudio-blockedevent). - The avatar shows but the bot stays silent: check the
AZURE_*settings and read the bot log for errors. An Azure message aboutVirtual Network/Firewall rulesmeans your Azure resource does not allow the machine that runs the bot. - “Avatar unavailable”: the voice continues without the face, and the message gives the reason, for example
SDK_UPGRADE_REQUIREDfor an SDK older than 1.11.48. - Port already in use: run
uv run examples/bot.py --port 7861, setMESHLITE_ORIGINtohttp://localhost:7861, and add that address in Allowed sites.
Guide: an ElevenLabs Agents voice with a MeshLite face
Your visitors talk to an ElevenLabs Agents conversation, and a MeshLite avatar moves its lips in sync. You keep ElevenLabs voices, including your cloned voices, and you choose the brain among the models ElevenLabs offers (Claude, GPT, Gemini and others). MeshLite draws the face in the visitor’s browser. You write no server code for the voice. Count about 5 minutes.
How it works: you connect your ElevenLabs key once in the Console. MeshLite creates the ElevenLabs agent in your own account with your avatar’s personality, language and voice, and reuses it for the next conversations. For each conversation, the visitor’s browser gets a short single-use pass and talks directly to ElevenLabs. Your key stays in our vault and never reaches a browser. No video server and no GPU. You pay ElevenLabs for the conversation on your own account, and there is no per-minute avatar fee.
What you need
- A MeshLite account on any plan (on the Free plan, the avatar shows the MeshLite watermark).
- An ElevenLabs account with an API key.
- An avatar that already works on your site or in a project (see the steps above, or create a project with no code).
1. Create a restricted ElevenLabs key
In ElevenLabs, create an API key only for MeshLite, with these permissions: Agents: write and Voices: read. Set a credit limit on the key. Even if a visitor cheats, your cost stays bounded.
2. Connect it in the Console
In the Console, open the LLM (brains) tab, Your AI provider:
- Choose ElevenLabs Agents and paste your key. MeshLite checks it against your ElevenLabs account.
- Choose the brain (the model that answers) and the voice. The list shows the voices of your account, including cloned ones.
- Set the limits: minutes per visitor per day, minutes per day for all visitors, and a monthly budget. Each conversation gets the smallest time left among these limits.
When the provider is ready, it takes precedence over the voice service chosen in the TTS (voices) tab.
3. Talk to your avatar
Open your page or your project link and start a conversation. The avatar answers with the ElevenLabs voice and matching lips. The language on screen follows the agent, and the visitor’s language choice goes to the agent. Your page code does not change: the same MeshLite.mount(…) call from Mount the avatar in your page works.
4. Go to production
- Keep the credit limit on the ElevenLabs key, and the minute limits in the Console.
- Protect
/api/sessionas noted in Issue session tokens from your server. - One conversation lasts at most 30 minutes.
If something does not work
- The key is refused: check the two permissions (Agents: write, Voices: read) and that the key is not expired.
- No voice in the list: your ElevenLabs account has no usable voice. Add one in ElevenLabs, then reload the tab.
- The avatar uses another voice: check that Your AI provider shows “Ready” with ElevenLabs Agents.
- To stop: remove the key in Your AI provider. It is deleted from the vault, and visitors can no longer talk with this provider.
Reference
- Versions: the current SDK is 1.11.52. Pin an exact version; the Console’s Code tab (Projects, For developers) always shows the current one. Only recent versions are served. Older version URLs redirect to the current one, so update the pinned version when a new one is released.
- Types:
https://console.meshlite.io/sdk/1.11.52/meshlite.d.ts - Content Security Policy: if your site has one, allow
https://console.meshlite.ioinscript-srcandframe-src, and also inconnect-srcfor the code to paste from a project. If you send a Permissions-Policy header, allow the microphone for that origin too. - LiveKit agents: the avatar can lip-sync the voice of your own LiveKit agent, which keeps its own brain and voice. The step-by-step guide above takes you from a Console account to a talking avatar with one command. The plugin repository has the full options and the example code.
- Pipecat bots: the avatar can lip-sync the voice of your own Pipecat bot. Add
MeshLiteAvatarProcessorfrompipecat-meshliteto the bot, and the page hands the voice over withavatar.attachPipecat(client). The step-by-step guide above runs a complete demo. - Browsers: HTTPS is required in production. Older browsers that can’t run the avatar show an idle preview only; check
MeshLite.supportsConversation(). - Common errors:
ORIGIN_NOT_ALLOWEDmeans the page’s origin (port included) is not registered in the keys’ environment;ENVIRONMENT_MISMATCHmeans a test key is paired with a live key;VOICE_PROVIDER_REQUIREDmeans no voice provider is connected. The full guide lists every option, event and error.
Questions about your integration? Write to hello@meshlite.io.