> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: LiveKit Agents
description: Use Vakyam TTS as the voice in a LiveKit Agents pipeline.
---

# LiveKit Agents

The Vakyam Python SDK ships a `VakyamTTS` plugin for
[LiveKit Agents](https://docs.livekit.io/agents/).
It streams PCM audio over the realtime [WebSocket API](/guides/realtime-websocket)
for low latency and sentence-tokenizes incoming text so each utterance matches
Vakyam's one-sentence-per-message protocol.

## Install

Install the SDK with the `livekit` extra:

```bash
pip install "vakyamai[livekit]"
```

Set your API key:

```bash
export VAKYAM_API_KEY="vak_live_..."
```

## Create the TTS plugin

```python
from vakyamai.livekit import VakyamTTS

tts = VakyamTTS(
    model="raaga-v1",
    voice="Archana",
    language="ta-IN",
    sample_rate=24000,
    speed=1.0,
)
```

The plugin reads `VAKYAM_API_KEY` from the environment by default; pass
`api_key="vak_live_..."` to set it explicitly.

### Parameters

- `api_key` (string) — Vakyam API key. Defaults to the `VAKYAM_API_KEY` environment variable.

- `model` (string, default raaga-v1) — TTS model identifier.

- `voice` (string, default Archana) — Voice selector — a preset name (discover valid values with `GET /v1/voices`) or a custom voice ID beginning with `vc_`. See [Voices & languages](/concepts/voices-and-languages).

- `language` (string, default ta-IN) — BCP 47 language code, such as `ta-IN`, `hi-IN`, or `en-IN`.

- `sample_rate` (integer, default 24000) — Output PCM sample rate in Hz: `8000`, `16000`, `24000`, or `48000`.

- `speed` (number, default 1.0) — Speech rate multiplier, `0.5`–`2.0`.

- `base_url` (string, default https://api.vakyam.ai) — API base URL. Defaults to production (`https://api.vakyam.ai`).

- `tokenizer` (SentenceTokenizer) — Optional custom sentence tokenizer. Defaults to LiveKit's built-in sentence tokenizer.

## Use it in an AgentSession

Combine `VakyamTTS` with your chosen STT, LLM, and VAD, the same way you would
wire any other LiveKit TTS plugin:

```python
from livekit.agents import AgentSession
from vakyamai.livekit import VakyamTTS

session = AgentSession(
    stt=your_stt,
    llm=your_llm,
    tts=VakyamTTS(
        model="raaga-v1",
        voice="Archana",
        language="ta-IN",
        sample_rate=24000,
    ),
    vad=your_vad,
)
```

> **Note:**
> `VakyamTTS` supports streaming synthesis and interruption. When the user barges
> in, LiveKit cancels the active synthesis, which sends a `cancel` to Vakyam and
> keeps the session ready for the next turn. See
> [Interrupting playback](/guides/realtime-websocket#interrupting-playback-barge-in).

---

*Powered by [holocron.so](https://holocron.so)*
