Skip to main content
The Lokutor SDKs handle the WebSocket connections, audio capture and playback, resampling, and conversation state. The JavaScript and Python SDKs have the same classes.

Installation

Works in browsers (Vite, React, vanilla) and in Node.js 22 or later (the SDK uses the global WebSocket). Browser apps play audio with the Web Audio API. Current version: 1.6.0.

Credentials

Create an API key at app.lokutor.com and keep it on the server:
In a browser, never use the key itself. Your backend exchanges it for a short-lived ticket and the page passes the ticket: VoiceAgentClient fetches one before every connection through its auth option. See Secure browser setup.

Clients

Discovery helpers read the voices, languages and limits without a key.

Platform notes

  • Browser: the microphone and AudioContext need a user gesture (a click). See Browser Setup.
  • Node.js: needs Node.js 22+. For microphone and speaker, install speaker and node-record-lpcm16 and use NodeAudioManager. See Node.js Setup.
  • Python: local audio uses PyAudio, installed with lokutor[audio].

Reference