Kenpath Labs

SDKs & compatibility

The Svara Python SDK, and using the OpenAI or ElevenLabs SDKs against Svara.

Svara Python SDK

The official SDK. One dependency-light package (httpx + websockets) that covers the whole surface: sync and async clients, HTTP streaming, the input-streaming WebSocket behind one method call, pronunciation dictionaries, a CLI, and drop-in LiveKit / Pipecat plugins. The distribution is svara-voice; the import is import svara.

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)
# low latency: stream chunks as they generate
for chunk in client.speech.stream(input="...", voice="sv_enhdbrj5",
response_format="pcm"):
player.feed(chunk)
The SDK installs from the repository until the first PyPI release lands; after that, pip install svara-voice is the same package and the same import. Extras use the same URL: pip install "svara-voice[livekit] @ git+https://github.com/kenpath-labs/svara-python.git".

OpenAI SDKs

The official OpenAI Python and JavaScript SDKs work against Svara unmodified: point base_url at Svara and pass your key. Svara-specific fields ride in extra_body (Python) or as extra properties (JS).

pip install openai
from openai import OpenAI
client = OpenAI(base_url="https://api.kenpathlabs.com/v1", api_key=SVARA_API_KEY)
audio = client.audio.speech.create(
model="svara-1",
voice="sv_enhdbrj5", # Aanya
input="Namaste!",
response_format="mp3",
extra_body={"lang": "hindi", "stream": False}, # svara extensions
)
audio.write_to_file("out.mp3")

ElevenLabs SDKs

The official ElevenLabs SDKs also work unmodified, including their realtime WebSocket client. Pass any non-empty api_key; its presence is also how GET /v1/models decides to answer in the ElevenLabs array shape.

pip install elevenlabs
from elevenlabs.client import ElevenLabs
client = ElevenLabs(base_url="https://api.kenpathlabs.com", api_key=SVARA_API_KEY)
audio = client.text_to_speech.convert(
voice_id="sv_enhdbrj5", # Aanya
text="Namaste!",
model_id="eleven_multilingual_v2", # accepted, ignored
output_format="mp3_44100_128",
)

Base URL conventions

Mind the /v1: OpenAI SDKs include it in the base URL (https://api.kenpathlabs.com/v1), while ElevenLabs SDKs do not (https://api.kenpathlabs.com); they append v1/… themselves.

Compatibility surface

What maps, and what to expect:

  • Full support: TTS + streaming, all output formats and rates, timestamps, the realtime WebSocket, voice list/search, models, languages.
  • Honored: voice_settings.speed maps onto the native speed parameter (their 0.7–1.2 range sits inside our 0.7–1.5) — on HTTP, with-timestamps and the realtime WebSocket alike.
  • Accepted and ignored: voice_settings (stability/similarity/style), seed, model_id, previous_text/next_text, request stitching. These don’t map onto this model; requests including them still succeed. (Pronunciation dictionaries are supported — see the guide.)
  • Stubbed: user/subscription and voice-settings endpoints return valid, permissive shapes so SDK flows don’t break.

A machine-readable OpenAPI document is served live at https://api.kenpathlabs.com/openapi.json: generate typed clients from it (Fern, Stainless, Scalar) for languages the official SDK doesn’t cover yet.