Skip to main content
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

This flow does not require a Cartesia API key in your app. Anam uses the saved Cartesia voice attached to the Anam voiceId.

Installation

Set your Node project to ESM so the backend and frontend snippets work as written (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

The 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.
You can also clone a Cartesia voice or import a Cartesia provider voice in Lab. When importing, set the provider voice ID and a default provider model such as 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:
The sample below uses a browser module entry file. Wrap the call in an async function if your frontend is not a module.
When the session starts, the video element shows Liv speaking with the Siobhan Cartesia voice. Try asking a short question in the browser.

Voice and performance options

Use voiceGenerationOptions 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.

Resources