Skip to main content
@kova-ai/tts is the official JavaScript/TypeScript client. Works in Node 18+. Source: github.com/evalabs-ai/kova-tts-clients.
The WebSocket helper requires a Node runtime — browsers cannot reliably set the x-api-key handshake header. Use Streaming HTTP for browser clients, or proxy the WebSocket through a Node backend.

Install

Initialize

By default the client targets https://api.kova.ai/v1/tts. Override baseUrl for staging or self-hosting:

Sync TTS

result.audio is the decoded audio bytes (Uint8Array), not base64.

Streaming TTS

streamTTS returns an async iterable of events:

WebSocket

Helpers

For listing voices, use raw HTTP — the SDK does not currently expose a listVoices method:

Errors

The SDK throws a KovaTTSError on non-2xx responses. The error carries the HTTP status and the parsed JSON body:
See Errors for the full status-code reference.

See also