> ## 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.

# POST /v1/tts

> One request, one clip, streaming back as it is generated.

```
POST https://tts.mayaresearch.ai/v1/tts
```

One request, one clip. The audio still **streams back** as it is generated —
you just get one request/response, with no turns and no barge-in.

## Body

<ParamField body="text" type="string" required>
  The whole thing, in one request. No SSML, HTML or markdown — tags are read
  aloud literally.
</ParamField>

<ParamField body="voice" type="string" default="Ananya">
  `Ananya` or `Arjun`. **Case-sensitive** — the model interpolates whatever it
  is given, so `ananya` produces different audio.
</ParamField>

<ParamField body="language" type="string">
  One of the eleven [language codes](/reference/languages). Auto-detected when
  omitted — leave it out for code-mixed text.
</ParamField>

<ParamField body="model" type="string" default="Maya 2 Native">
  Which model answers.
</ParamField>

## Response

<ResponseField name="content-type" type="audio/L16; rate=24000; channels=1">
  Raw PCM — 16-bit little-endian, mono, 24000 Hz. **No file header.**
</ResponseField>

<Warning>
  The body is binary. Decoding it as UTF-8 corrupts it, and writing it straight
  to a `.wav` file produces something no player will open — see
  [Quickstart](/quickstart) for the one-line conversion.
</Warning>

## Reuse the connection

The single biggest thing you control:

|                            | First audio |
| :------------------------- | ----------: |
| New connection per request |      389 ms |
| Connection reused          |   **88 ms** |

<RequestExample>
  ```bash curl theme={null}
  curl -sS --fail-with-body -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",
      },
  )
  r.raise_for_status()
  pcm = r.content
  ```
</RequestExample>

<ResponseExample>
  ```json Error theme={null}
  {
    "error": "unknown_voice",
    "voice": "ananaya",
    "available": ["Ananya", "Arjun"]
  }
  ```
</ResponseExample>
