Kenpath Labs

Introduction

Text to speech over HTTP and WebSocket, in 80 languages, from one endpoint.

Overview

The Svara API converts text to speech over HTTP and WebSocket. One model covers 80 languages and code-switches within a single request, with a library of 320 voices and eight output formats. Streamed, first audio typically arrives in a few hundred milliseconds.

  • POST /v1/audio/speech synthesizes text you already have, buffered or streamed
  • WS /v1/audio/speech/stream-input takes text as it is produced — an LLM token stream, for example — and returns audio continuously
  • ulaw and alaw at 8 kHz come out of the API directly, so telephony needs no transcoding step

Base URL

https://api.kenpathlabs.com/v1

Compatibility

The API is request-compatible with the OpenAI and ElevenLabs speech APIs. If your code already calls either one, change the base URL and the key; no other edits are required.

  • OpenAI: POST /v1/audio/speech — the primary endpoint, and the one that exposes every Svara parameter. The official OpenAI SDKs work unmodified.
  • ElevenLabs: POST /v1/text-to-speech/{voice_id} and the related streaming, timestamp, and voices endpoints. The official ElevenLabs SDKs work unmodified, including their realtime WebSocket client.
  • Native WebSocket: /v1/audio/speech/stream-input — Svara-specific, and the lowest-latency path for LLM-driven speech.

Per-SDK setup, including the /v1 difference between the two base URL conventions, is on SDKs & compatibility.

Your first call

POST/v1/audio/speech
# pip install git+https://github.com/kenpath-labs/svara-python.git
from svara import Svara
client = Svara() # reads SVARA_API_KEY
audio = client.speech.create(
input="नमस्ते! Welcome to Svara.",
voice="sv_enhdbrj5", # Aanya
response_format="mp3",
)
open("hello.mp3", "wb").write(audio)

That mixed Hindi-English input is intentional: send raw text in any supported language, code-switching included, and the model handles it. No SSML, no phoneme markup.

Next steps

A machine-readable OpenAPI spec is served live at https://api.kenpathlabs.com/openapi.json: handy for generating typed clients.