Skip to main content

create-simli-app-elevenlabs

A Next.js app that gives an ElevenLabs agent a Simli avatar.
The page connects to your ElevenLabs agent over a WebSocket, sends the agent your microphone, and plays the agent’s voice through the avatar with the JavaScript SDK. Both API keys stay on the server: /api/simli-token creates the Simli session token, and /api/elevenlabs-signed-url gets a short-lived signed URL for the agent. In the ElevenLabs agent’s settings, set the TTS output format to PCM 16000 Hz (Simli needs 16 kHz PCM) and a short first message, so the avatar greets you as soon as the conversation opens. To run it, copy .env.example, fill in SIMLI_API_KEY, ELEVENLABS_API_KEY and ELEVENLABS_AGENT_ID, then run npm install and npm run dev. The README has the details.
In production, both routes return 403 until you put them behind your own sign-in, because anyone who can call them starts a conversation on your Simli and ElevenLabs accounts. Also set call and duration limits on the ElevenLabs agent. See the README’s “Before you deploy”.