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

# Papla

> Use the Papla text-to-speech plugin in a Zero Runtime pipeline. Setup and usage in JavaScript.

Papla is a **text-to-speech** plugin. It converts the agent's text responses into speech.

## Setup

Set your Papla API key in the worker environment. Generate a key from the [Papla site](https://papla.media/):

```bash theme={null}
export PAPLA_API_KEY=<key>
```

## Usage

Import the plugin and pass it to the pipeline's `tts` slot.

```typescript Node JS theme={null}
import { PaplaTTS } from '@zeroruntime/js-sdk/plugins';

const tts = PaplaTTS();

// Pipeline({ tts, ... })
```

> [!NOTE]
>
> `PaplaTTS` ships in the Node JS SDK only. The Python SDK does not include this plugin yet.

## Parameters

*Constructor parameters for `PaplaTTS`.*

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `string` | `null` | Papla API key. Falls back to the `PAPLA_API_KEY` environment variable when unset. |
| `model_id` | `string` | `"papla_p1"` | Papla model. |
| `base_url` | `string` | `"https://api.papla.media/v1"` | Papla API base URL. |

## Import paths

| SDK | Import | Constructor |
| - | - | - |
| Node JS | `import { PaplaTTS } from '@zeroruntime/js-sdk/plugins'` | `PaplaTTS()` |

Synthesized audio is streamed back to the caller after the [LLM](https://docs.zeroruntime.ai/runtime-sdk/plugins/overview.md) produces a response.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.