> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mayaresearch.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Maya API

> Streaming text-to-speech for eleven Indian languages, in two voices.

Text-to-speech for eleven Indian languages, including Indian English. Two voices,
both speaking every language, streaming 24 kHz audio.

Audio starts arriving **before the clip is finished**, so you can play it as it
lands rather than waiting for the whole thing.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/quickstart">
    A clip playing in under a minute.
  </Card>

  <Card title="Voice agents" icon="microphone" href="/guides/voice-agents">
    One socket, a whole conversation, with barge-in.
  </Card>
</CardGroup>

## At a glance

|                  |                                       |
| :--------------- | :------------------------------------ |
| **Base URL**     | `https://tts.mayaresearch.ai`         |
| **One clip**     | `POST /v1/tts`                        |
| **Voice agents** | `WSS /v1/tts/stream`                  |
| **Auth**         | `Authorization: Bearer <key>`         |
| **Output**       | raw PCM · 16-bit LE · mono · 24000 Hz |
| **Voices**       | `Ananya`, `Arjun`                     |
| **Languages**    | 11, including Indian English          |

## Which one to use

**HTTP** for one-off synthesis — a clip for a page, a batch job, anything where
you already have the whole text.

**WebSocket** for conversational agents. One connection carries a whole
conversation: you push text as your LLM writes it, and you can cut a turn off
the moment the user interrupts.

## Latency

First audio byte, measured against Mumbai:

| How you call it                | First audio |
| :----------------------------- | ----------: |
| WebSocket, per turn            |   **83 ms** |
| HTTP, connection reused        |   **88 ms** |
| HTTP, new connection each time |      389 ms |

<Warning>
  A TLS handshake costs about 300 ms, and a client that opens a new connection
  per request pays it **every single time**. `requests.Session()` in Python, a
  shared agent in Node — either one gets you socket-level latency over plain
  HTTP.
</Warning>

<RequestExample>
  ```bash curl theme={null}
  curl -X POST https://tts.mayaresearch.ai/v1/tts \
    -H "Authorization: Bearer $MAYA_API_KEY" \
    -H "content-type: application/json" \
    -d '{"text":"नमस्ते!","voice":"Ananya","language":"hi"}' \
    --output out.pcm
  ```

  ```python Python theme={null}
  import requests

  session = requests.Session()
  r = session.post(
      "https://tts.mayaresearch.ai/v1/tts",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={"text": "नमस्ते!", "voice": "Ananya", "language": "hi"},
  )
  pcm = r.content
  ```
</RequestExample>

<ResponseExample>
  ```
  content-type: audio/L16; rate=24000; channels=1

  <raw PCM bytes — 16-bit little-endian, mono, 24000 Hz>
  ```
</ResponseExample>
