Skip to main content
This guide walks you through building your first voice agent in under 10 minutes. You will create a web page with a single button that starts a conversation, shows the agent’s status, and displays the transcript in real time.

What you will build

A web page with:
  • A Start button that requests microphone permission and connects to Lokutor
  • A status indicator that shows whether the agent is listening, thinking, or speaking
  • A transcript panel that displays what the user said and what the agent replied

Prerequisites

  • An API key from app.lokutor.com
  • A modern browser with microphone support (Chrome, Firefox, Edge, Safari)
  • Node.js installed on your machine

Step 1: Create the project

Create a .env file:

Step 2: Write the HTML

Replace index.html with:

Step 3: Write the agent logic

Replace src/main.ts with:

Step 4: Run it

Open http://localhost:5173 in your browser, click Start Conversation, and speak into your microphone.

How it works

  1. startManaged() requests microphone permission and opens a WebSocket to Lokutor
  2. The SDK sends your configuration (prompt, voice, language) to the server
  3. When you speak, the SDK streams microphone audio to the server
  4. The server runs VAD, STT, LLM, and TTS, then streams audio back
  5. The SDK plays the audio and emits events for transcription, response, and status

Next steps

Complete code

You can find the full source for this guide in the examples repository.