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

# Quickstart

> A clip playing in under a minute.

## 1. Get a key

Create one in the [studio](https://www.mayaresearch.ai/studio/developers).
Access is currently limited — a promo code unlocks it.

```bash theme={null}
export MAYA_API_KEY="maya_hk_live_..."
```

## 2. Make a request

<CodeGroup>
  ```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()          # reuse the connection

  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()
  open("out.pcm", "wb").write(r.content)
  ```

  ```js Node theme={null}
  const res = await fetch("https://tts.mayaresearch.ai/v1/tts", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.MAYA_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({
      text: "नमस्ते! आपका ऑर्डर कल पहुँच जाएगा।",
      voice: "Ananya",
      language: "hi",
    }),
  });
  if (!res.ok) throw new Error(await res.text());

  // Stream it as it arrives rather than buffering the whole clip.
  for await (const chunk of res.body) {
    // chunk is raw PCM — feed it straight to your player
  }
  ```
</CodeGroup>

<Warning>
  **Keep `--fail-with-body`.** Without it, curl writes the JSON error body
  *into* `out.pcm` on a 4xx, and the next command turns that JSON into a silent
  0-second file. A bad key then looks like "the audio is empty" instead of an
  error.
</Warning>

## 3. Make it playable

The response has **no file header** — it is raw samples. Every player has to be
told what they are:

<CodeGroup>
  ```bash Convert theme={null}
  ffmpeg -f s16le -ar 24000 -ac 1 -i out.pcm out.wav
  ```

  ```bash Play directly theme={null}
  ffplay -f s16le -ar 24000 -ch_layout mono out.pcm
  ```
</CodeGroup>

`-f s16le -ar 24000 -ac 1` is the whole recipe: signed 16-bit little-endian,
24 kHz, mono. That is what `audio/L16; rate=24000; channels=1` means.

<Tip>
  Postman and most HTTP clients cannot play the response inline for the same
  reason — raw PCM carries no format information, so nothing can know the
  sample rate from the bytes. Save it and convert.
</Tip>

## Next

<CardGroup cols={2}>
  <Card title="Voice agents" icon="microphone" href="/guides/voice-agents">
    Barge-in, turns, and pushing text as your LLM writes it.
  </Card>

  <Card title="Voices & languages" icon="globe" href="/reference/voices">
    Two voices, eleven languages, and the rules that bite.
  </Card>
</CardGroup>
