Skip to main content

Connection errors

The WebSocket connection fails immediately

A browser only sees close code 1006, whatever the server said. The usual causes:
  • The credential is wrong or expired. Tickets (wst_…) last 10 minutes; with the JavaScript SDK use the auth option so a fresh one is fetched for every connection (Secure browser setup).
  • The balance is too low (402 at the handshake). Check the balance in the dashboard (Billing errors).
  • Too many sessions open (429 on /ws/agent). The account holds 3 at once before its first top-up, 10 after. Close sessions you are not using.
  • The agentId is not on your account (404 agent.not_found).
  • A firewall or proxy blocks outbound connections on port 443.
To see the real status, open the same URL from a server or with curl -i and read the response.

WebSocket is not defined (Node.js)

The SDK uses the global WebSocket, available in Node.js 22 and later. Upgrade Node.js.

Audio issues

The agent’s voice is choppy or distorted

  • Usually network jitter. Check the connection.
  • If you send audio yourself, send 16 kHz, 16-bit mono PCM in steady ~20 ms chunks.
  • Node.js: the speaker must be set to 44.1 kHz, 16-bit, mono (AUDIO_CONFIG).

No audio playback (Node.js)

  • Install speaker and pass a NodeAudioManager to connect() (Node.js Setup).
  • Check that no other application holds the audio device exclusively, and that ALSA/PulseAudio is working on Linux.

The microphone captures nothing

  • In a browser, the microphone must be requested from a click or tap. On iOS Safari, request it inside the tap with requestMicrophone() (Starting a call on a phone).
  • Check that permission was granted and the right input device is selected.

The agent answers itself

Its voice is leaking from the speakers into the microphone. Use headphones, or in a browser keep echoCancellation on (the default).

Python

ModuleNotFoundError: No module named 'lokutor'

Install it with pip install lokutor, in the virtual environment you run from.

PyAudio fails to install, or playback says PyAudio is missing

PyAudio is only needed to play or record on the local machine, and it needs the PortAudio library:
Calling the API without local audio (play=False, transcribing files) works with plain pip install lokutor.
For more help, write to [email protected].