> ## Documentation Index
> Fetch the complete documentation index at: https://daily-main.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Maya Text-to-Speech

> Stream Indian-language TTS with MayaTTSService, or use MayaHttpTTSService for HTTP synthesis, in a Pipecat pipeline.

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="Maya Research" maintainerUrl="https://github.com/MayaResearch" repo="https://github.com/MayaResearch/pipecat-maya" />

## Overview

[Maya Research](https://www.mayaresearch.ai/) maintains this integration for its
text-to-speech API. Use `MayaTTSService` for conversational agents: it keeps a
WebSocket open across turns, streams audio as it arrives, and cancels the active
turn when the user interrupts. `MayaHttpTTSService` uses the HTTP streaming API.

Both services support Maya 2 Native and Maya Calyx. The package handles the wire
protocol, text chunks, and conversion to Pipecat audio frames. You can use it
with an existing STT, LLM, and transport.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/MayaResearch/pipecat-maya">
    Installation, runnable examples, tests, and issue tracker
  </Card>

  <Card title="Maya API Reference" icon="book" href="https://www.mayaresearch.ai/llm.txt">
    Current models, voices, languages, formats, and API behavior
  </Card>
</CardGroup>

## Installation

Install the community package from its versioned Git release:

```bash theme={null}
uv add "pipecat-maya @ git+https://github.com/MayaResearch/pipecat-maya.git@v0.1.0"
```

Or install into an existing Python environment:

```bash theme={null}
python -m pip install "pipecat-maya @ git+https://github.com/MayaResearch/pipecat-maya.git@v0.1.0"
```

## Prerequisites

Request an API key from [Maya Research](mailto:charan@mayaresearch.ai), then set
`MAYA_API_KEY` in the server environment. Keep the key out of browser code.

```bash theme={null}
export MAYA_API_KEY="your-api-key"
```

## Configuration

Pass an API key and optional runtime settings to either service:

```python theme={null}
import os

from pipecat_maya import MayaTTSService

tts = MayaTTSService(
    api_key=os.environ["MAYA_API_KEY"],
    settings=MayaTTSService.Settings(
        model="Maya 2 Native",
        voice="Ananya",
    ),
)
```

### Settings

Pass these through `MayaTTSService.Settings(...)` or
`MayaHttpTTSService.Settings(...)`. Use a
[`TTSUpdateSettingsFrame`](/pipecat/fundamentals/service-settings) to change them
during a conversation.

| Parameter  | Type                      | Default           | Description                                                                                       |
| ---------- | ------------------------- | ----------------- | ------------------------------------------------------------------------------------------------- |
| `model`    | `str`                     | `"Maya 2 Native"` | `"Maya 2 Native"` or `"Maya Calyx"`. Names are case-sensitive.                                    |
| `voice`    | `str`                     | `"Ananya"`        | A case-sensitive voice name belonging to the selected model.                                      |
| `language` | `Language \| str \| None` | `None`            | Auto-detect when omitted. Set a supported language only when it matches the text.                 |
| `speed`    | `float \| None`           | `None`            | Maya 2 Native only, from `0.5` to `1.25`. `None` resets Native to `1.0` and omits speed on Calyx. |

Maya 2 Native offers `Ananya` and `Arjun`. Maya Calyx has a separate voice roster,
including `Aarav` and `Tarini`. When changing models, change the voice in the
same settings update. See the [Maya API reference](https://www.mayaresearch.ai/llm.txt)
for the complete voice catalog. Clear a Native-only speed setting with
`speed=None` when switching to Calyx. On Native, `speed=None` or `speed=1.0`
restores normal speed.

Supported language codes are `hi`, `bn`, `gu`, `kn`, `ml`, `mr`, `or`, `pa`, `ta`,
`te`, and `en`. `en` is Indian English. Leave `language=None` for mixed-language
text. An explicit language that does not match the text can produce the wrong
pronunciation even when the API accepts the request.

### HTTP synthesis

Use the HTTP service in the same pipeline position:

```python theme={null}
import os

from pipecat_maya import MayaHttpTTSService

tts = MayaHttpTTSService(
    api_key=os.environ["MAYA_API_KEY"],
    settings=MayaHttpTTSService.Settings(
        model="Maya Calyx",
        voice="Aarav",
    ),
)
```

Maya Calyx supports HTTP audio at 8, 16, and 24 kHz, with PCM or G.711 mu-law
encoding. Maya 2 Native produces 24 kHz PCM. The integration converts provider
audio to the PCM frames expected by Pipecat. See the
[package documentation](https://github.com/MayaResearch/pipecat-maya) for
transport and audio-format options.

## Usage

Place the service after your LLM and before your transport output. Keep the
assistant context aggregator after the output transport:

```python theme={null}
from pipecat.pipeline.pipeline import Pipeline

pipeline = Pipeline(
    [
        transport.input(),
        stt,
        context_aggregator.user(),
        llm,
        tts,
        transport.output(),
        context_aggregator.assistant(),
    ]
)
```

The surrounding `transport`, `stt`, `llm`, and `context_aggregator` are your
existing pipeline components. For a complete runnable example, follow the
[package README](https://github.com/MayaResearch/pipecat-maya#readme).

### Text chunks and interruptions

Use the default sentence aggregation for streamed LLM output. The WebSocket
service associates chunks with their Pipecat context and closes the turn when
text generation finishes. Callers do not need to manage Maya context IDs,
continuation flags, or cancellation messages.

Use Pipecat's [interruption handling](/pipecat/fundamentals/interruptions) so
playback stops as soon as the user interrupts. The service cancels generation
and discards late audio for the interrupted context. Stopping generation alone
cannot remove audio that a custom client has already buffered.

Send plain text. Maya reads SSML and markup literally; use Pipecat's
[text processing](/pipecat/learn/text-to-speech#text-processing-and-filtering)
when your LLM produces markup. Maya does not provide word timestamps, so the
integration cannot report exact word-level playback timing.

<Warning>
  Validation found incomplete sentences in some Calyx/Amit HTTP responses. The
  package documents the provider-level reproduction and the tested Native
  default in its [validation
  report](https://github.com/MayaResearch/pipecat-maya/blob/main/docs/validation.md).
  API acceptance is not a guarantee of voice or language quality.
</Warning>

## Compatibility

This release requires and pins Pipecat v1.8.1. Check compatibility before adding
it to an environment that requires another Pipecat version. See the
[package repository](https://github.com/MayaResearch/pipecat-maya) for the tested
Python versions, release changelog, and validation results.
