swaram is a real-time Malayalam voice API. You stream a user's voice over a WebSocket and natural Malayalam speech streams back — speech in, Malayalam out. You bring the context (your instructions, tools, and data); swaram is the voice.
- Base URL:
wss://api.swaram.live/v1/realtime - Sign up & API keys: app.swaram.live
- Live docs: swaram.live/docs
swaram speaks the OpenAI Realtime event protocol, so most existing real-time voice clients work by changing just three things:
- URL →
wss://api.swaram.live/v1/realtime - API key → your
swaram_…key - model →
mal-realtime-simple(ormal-realtime-premium)
Everything else — the events, tools, and audio format — is the same.
import asyncio, base64, json, websockets
URL = "wss://api.swaram.live/v1/realtime?model=mal-realtime-simple"
async def main():
headers = {"Authorization": "Bearer swaram_your_key_here"}
async with websockets.connect(URL, additional_headers=headers) as ws:
await ws.send(json.dumps({"type": "session.update", "session": {
"instructions": "You are a friendly Malayalam assistant.",
"voice": "mal-female",
}}))
await ws.send(json.dumps({"type": "input_audio_buffer.append",
"audio": base64.b64encode(pcm16_chunk).decode()}))
async for raw in ws:
event = json.loads(raw)
if event["type"] == "response.output_audio.delta":
play(base64.b64decode(event["delta"])) # PCM16 @ 24 kHz
asyncio.run(main())Full walkthrough (Python / Node / Browser): docs/quickstart.md.
| Values | ||
|---|---|---|
model |
mal-realtime-simple · mal-realtime-premium |
Simple = low cost · Premium = lower latency + more expressive |
voice |
mal-female (default) · mal-male |
Same voices in both modes |
| Audio | PCM16 · 24 kHz · mono · base64 | Same in and out |
See docs/models.md for the full reference.
Ready-to-run example apps live in github.com/pattern-ai-labs/swaram-apps. Clone it and start from a working integration.
Get started
- Introduction — what swaram is, the base URL, the two modes.
- Quickstart — connect, configure, stream audio, play the reply (Python/Node/Browser).
- Authentication — server-side keys and short-lived browser tokens.
Build
- Models & voices — the literal
model/voiceids and the audio format. - Sessions & context — configure instructions/voice/tools; lifetime, reconnection & limits.
- Function calling — give swaram tools to act on; the call/return round-trip.
- Audio — PCM16 in/out, chunking, playback, echo cancellation.
- Transcripts — read what the user said and what swaram said back.
- Turn-taking & barge-in — automatic turns, interrupting, sending only the user's voice.
Reference
- Events reference — every client and server event, plus close codes.
- Errors — error events, close codes, and reconnection.
Help
- FAQ — modes, languages, phone calls, billing, and data.
These docs are plain Markdown, designed to be read by tooling and agents. The whole set is also served as a single file you can drop into an agent for the entire API in one read:
- Index: swaram.live/llms.txt
- Everything in one file: swaram.live/llms-full.txt
- Any page as raw Markdown:
https://swaram.live/docs/<page>.md
Documentation licensed under the MIT License.