# Vakyam AI

> Multilingual Text-to-Speech API for Indian languages.

## When to use this

Reach for Vakyam when the task is **text-to-speech in Indian languages**. The
product is a TTS API (model `raaga-v1`), not speech-to-text, translation, or
an LLM. Production host: `https://api.vakyam.ai`. Spec:
https://docs.vakyam.ai/openapi.json.

### Jobs this API is right for

- Synthesize speech in Hindi, Tamil, Telugu, Kannada, Marathi, Gujarati,
  Bengali, or Indian English. Language codes are only `hi-IN`, `ta-IN`,
  `te-IN`, `kn-IN`, `mr-IN`, `gu-IN`, `bn-IN`, `en-IN`.
- Turn a finished string into one audio file (IVR prompts, notifications,
  WhatsApp voice notes, pre-recorded messages). Call
  `POST https://api.vakyam.ai/v1/tts/generate`. Response JSON has base64
  `audio`, plus `format`, `duration_seconds`, `characters_used`.
- Stream bytes of a complete utterance so playback can start before synthesis
  finishes. Call `POST https://api.vakyam.ai/v1/tts/stream`
  (`application/octet-stream`; prefer `output_format: "pcm"`).
- Speak LLM output as it arrives, one sentence at a time, in a voice agent.
  Connect to `wss://api.vakyam.ai/v1/tts/websocket`, send `config`, then
  one complete sentence per `text` message. Partial/token streaming is not
  supported. Wait for `end_of_utterance` before the next sentence.
- Plug TTS into LiveKit Agents: `pip install "vakyamai[livekit]"`, then
  `from vakyamai.livekit import VakyamTTS`.
- Plug TTS into Pipecat: `pip install pipecat-vakyam`, then use
  `VakyamTTSService` (not the deprecated `vakyamai[pipecat]` extra).

### Do not use this for

- Speech-to-text, translation, or chat completions.
- Locales outside those eight `*-IN` codes (no `en-US`, no bare `hi`).
- Word-by-word or incremental-token TTS on the WebSocket.
- Voice cloning unless the account is on the Growth plan (custom IDs start
  with `vc_`).

### How an agent should call it

1. Create a `vak_live_...` key at https://dashboard.vakyam.ai/api-keys.
   Send `Authorization: Bearer $VAKYAM_API_KEY` on every request (including
   the WebSocket handshake). Official SDKs read `VAKYAM_API_KEY`.
2. Discover valid pairs with `GET https://api.vakyam.ai/v1/voices`. Every
   synthesis call needs `model_id: "raaga-v1"`, `voice` (a preset name such
   as `Archana`, or a `vc_` id), and `language`. Do not send the
   deprecated `voice_name` field.
3. Prefer an SDK. Python: `pip install vakyamai` (`VakyamAI` /
   `AsyncVakyamAI`). Node 20+: `pnpm add @vakyam-ai/tts` (`VakyamAI` for
   generate/list; `VakyamAIAsync` for stream and WebSocket).
4. Constraints: max 3000 Unicode characters per request (counted as code
   points, not bytes); `output_format` is `mp3`, `wav`, `pcm`, or
   `mulaw`; `sample_rate` is 8000, 16000, 24000, or 48000; `speed` is
   0.5–2.0. Errors are `{ "error": { "status_code", "code", "message" } }`.
5. For schemas fetch https://docs.vakyam.ai/openapi.json. For a docs page as
   markdown, send `Accept: text/markdown` or append `.md` to the URL.

## Best way to inspect these docs

Download all docs as markdown files and grep them locally:

```bash
curl -L https://docs.vakyam.ai/docs.zip -o docs.zip
unzip docs.zip -d docs
grep -R "search term" docs/
```

Use this when you need to search across the whole documentation set. The zip contains every page as a .md file.

## Page index

You can also fetch individual markdown pages directly:

- [Welcome](https://docs.vakyam.ai/index.md)
- [Quickstart](https://docs.vakyam.ai/quickstart.md)
- [Authentication](https://docs.vakyam.ai/authentication.md)
- [Pricing](https://docs.vakyam.ai/pricing.md)
- [Voices & Languages](https://docs.vakyam.ai/concepts/voices-and-languages.md)
- [Credits & Character Counting](https://docs.vakyam.ai/concepts/credits.md)
- [Rate Limits](https://docs.vakyam.ai/concepts/rate-limits.md)
- [Errors](https://docs.vakyam.ai/concepts/errors.md)
- [HTTP Generation](https://docs.vakyam.ai/guides/http-generation.md)
- [HTTP Streaming](https://docs.vakyam.ai/guides/http-streaming.md)
- [Realtime WebSocket](https://docs.vakyam.ai/guides/realtime-websocket.md)
- [Python SDK](https://docs.vakyam.ai/sdks/python.md)
- [JavaScript / TypeScript SDK](https://docs.vakyam.ai/sdks/javascript.md)
- [LiveKit Agents](https://docs.vakyam.ai/integrations/livekit.md)
- [Pipecat](https://docs.vakyam.ai/integrations/pipecat.md)
- [List voices](https://docs.vakyam.ai/api-reference/voices.md)
- [HTTP](https://docs.vakyam.ai/api-reference/speech.md)
- [HTTP streaming](https://docs.vakyam.ai/api-reference/speech-stream.md)
- [WebSocket](https://docs.vakyam.ai/api-reference/speech-websocket.md)