Last verified: 2026-08-05
Overview
Use this integration to speak a LiveAvatar avatar’s responses with a Cartesia Sonic TTS voice. Setprovider to cartesia in the session’s voice settings to render the avatar with Sonic — see Use your own Cartesia voices to import your own API key and voices.
Prerequisites
- LiveAvatar API key from app.liveavatar.com/developers
- Node.js 22+ and pnpm 9+
- Cartesia API key (
sk_car_...) from Cartesia keys — only for importing your own Cartesia voices
Quick start
The LiveAvatar Web SDK repo ships a Next.js demo app. Point it at your space, switch the TTS provider to Cartesia, and run it.Add your LiveAvatar API key
Set
API_KEY in apps/demo/app/api/secrets.ts. The avatar, voice, and context IDs already point at a working demo persona — swap them for your own once the session runs.Set Cartesia as the TTS provider
In The route returns
apps/demo/app/api/start-session/route.ts, add a voice_settings block inside the existing avatar_persona object in the session token request. The provider field selects which TTS engine renders the voice:{ session_token, session_id }, which the demo passes to LiveAvatarSession from @heygen/liveavatar-web-sdk.Run the demo
secrets.ts.The voice ID in
secrets.ts refers to the ID provided by LiveAvatar. It corresponds to the provider_voice_id, which is the voice ID provided by Cartesia. The two IDs are not the same, but they refer to the same voice.Use your own Cartesia voices
Register your Cartesia API key as a LiveAvatar secret, then bind a Cartesia voice to it — full flow in Custom TTS Integration. Getprovider_voice_id from the Cartesia playground or the list voices endpoint.
Set the environment variables used in the requests:
id:
voice_id (different from the Cartesia Voice ID you supplied). Use it as VOICE_ID in secrets.ts. LiveAvatar generates that session’s audio with your Cartesia credentials.
The imported voice stops working if the underlying Cartesia voice is deleted or the secret is removed.
Configuration
avatar_persona.voice_settings fields for Cartesia: