Skip to main content
Last verified: 2026-05-26

Overview

Use this integration to run a deployed Cartesia Line agent behind an Avaturn avatar. Your Cartesia agent handles prompts, tools, voice, and LLM behavior, while Avaturn handles the avatar session and rendering.

Prerequisites

  • Cartesia Line agent deployed with an agent_id (quickstart)
  • Cartesia API key (CARTESIA_API_KEY) from Cartesia keys
  • Avaturn API key (AVATURN_API_KEY) from the Avaturn dashboard
  • Node.js 18+ for the backend token/session endpoint
  • A frontend app that can render Avaturn Web SDK (integration guide)

Installation

Set your Node project to ESM so the backend and frontend snippets work as written (import syntax and top-level await):

Quick start

Create a Cartesia access token with the Auth API, create an Avaturn session with the Cartesia engine, then initialize the avatar in the browser with the returned session token.

1) Backend: mint Cartesia token and create Avaturn session

2) Frontend: initialize Avaturn with session token

Add a container in your page HTML where AvaturnHead renders the video stream:
The sample below uses top-level await and requires an ES module entry file. Wrap the call in an async function if your frontend is not a module.

Resources