Last verified: 2026-06-11
Overview
Use this integration to run an Anam interactive avatar with a Cartesia Sonic TTS voice. Anam handles the avatar session, WebRTC stream, and rendering, while a Cartesia voice provides the speech output.Prerequisites
- Anam API key (
ANAM_API_KEY) from the Anam Lab API keys page - Node.js 18+ for the backend token endpoint
- A frontend app that can render the Anam JavaScript SDK (production guide)
voiceId.
Installation
import syntax):
Quick start
Create an Anam session token with a Cartesia voice, then initialize the avatar in the browser with the returned session token.1) Backend: create an Anam session token
voiceId value is an Anam voice ID for a Cartesia voice, not a raw Cartesia provider voice ID. To find another one with the API, call the list voices endpoint and choose a voice where provider is CARTESIA. As of writing, Anam Lab lists 304 stock Cartesia voices.
sonic-3.5. Lab validates the voice before saving it as an Anam voice.
2) Frontend: initialize Anam with session token
Add a video element and a start button in your page HTML:Voice and performance options
UsevoiceGenerationOptions on the session token request to set Cartesia voice generation controls for the session, such as speed, volume, and emotion. See Anam’s voice configuration docs for supported values.
For advanced performance control, Anam can preserve Cartesia-supported inline cues in the transcript while also using the same cue names for avatar Director Notes where enabled. For example, Cartesia documents speech control tags; Anam can use a matching
laughter cue to shift the avatar toward a playful visual style.