Skip to main content
Complete step one: Agent configuration first. In this step, add the server route that connects your ElevenLabs agent to Anam.

Prerequisites

  • Node.js 20.9+
  • A Next.js project using the App Router, or the demo project
  • An Anam account and API key (sign up free at lab.anam.ai)
  • A Cara 4 avatar from the Anam Lab Avatars page
  • An ElevenLabs account with a Conversational AI agent configured via the dashboard

Create the server route

You need one API route. It fetches a signed URL from ElevenLabs, then passes it to Anam when creating a session token. API keys stay server-side. The client sends only the avatarId (which face to render) and agentId (which ElevenLabs agent to use).

Environment variables

API route

The environment.elevenLabsAgentSettings field configures ElevenLabs as the session’s speech recognition, language model, and text-to-speech provider. avatarModel and directorNotes enable a warm Cara 4 performance at the start of the session.
The signed URL is short-lived (typically valid for 15 minutes). Anam uses it immediately when the client connects, so there’s no issue with expiry in normal usage. If you’re pre-fetching tokens, create them just before the client needs them.
Your server route is ready. Next, start an avatar session in your browser.

Step 3: Start the avatar session

Connect the browser, enable your microphone, and have your first conversation with the avatar.
Last modified on October 8, 2026