DEV Community

Ramdai Bista
Ramdai Bista

Posted on Originally published at devtoolsreview.com

Build a Voice Agent with Claude Code and ElevenLabs (Oct 2026 Pricing + Code)

// server.js
import "dotenv/config";
import express from "express";

const app = express();

app.get("/conversation-token", async (req, res) => {
const response = await fetch(
https://api.elevenlabs.io/v1/convai/conversation/token?agent_id=${process.env.AGENT_ID},
{ headers: { "xi-api-key": process.env.ELEVENLABS_API_KEY } }
);
if (!response.ok) return res.status(500).send("Failed to get conversation token");
const body = await response.json();
res.send(body.token);
});

app.listen(3001);

Top comments (0)