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

# Gradium

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

Gradium is a **text-to-speech** plugin. It streams low-latency voices in English, French, German, Spanish, and Portuguese, plus your own clones.

## Setup

Set your Gradium API key in the worker environment. Generate a key from the [Gradium site](https://gradium.ai/):

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

## Usage

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

```python Python theme={null}
from zeroruntime.plugins import GradiumTTS

tts = GradiumTTS()

# Pipeline(tts=tts, ...)
```

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

> [!NOTE]
>
> `GradiumTTS` requires a `zeroruntime` release newer than 0.1.9.

## Parameters

*Constructor parameters for `GradiumTTS`.*

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | Gradium API key. Falls back to the `GRADIUM_API_KEY` environment variable when unset. |
| `model` | `str` | `"default"` | TTS model: "default" (stable) or "gradium-tts-beta" to follow betas. |
| `voice_id` | `str` | `"YTpq7expH9539ERJ"` | Gradium voice ID, from the catalog or your own voices. |
| `temperature` | `float \| None` | `None` | Output variety from 0 to 1.4. Leave unset for Gradium's default (0.7). |
| `padding_bonus` | `float \| None` | `None` | Speaking speed from -4 to 4. Negative is faster, positive slower. Leave unset for Gradium's default (0). |
| `rewrite_rules` | `str \| None` | `None` | Text rewriting rules, e.g. "en", or "none" to disable them. Leave unset to use the voice's language. |
| `pronunciation_id` | `str \| None` | `None` | Pronunciation dictionary to apply. Leave unset for none. |
| `base_url` | `str` | `"wss://api.gradium.ai/api/speech/tts"` | WebSocket endpoint of Gradium streaming text-to-speech. Change only for a proxy or a regional endpoint. |

## Import paths

| SDK | Import | Constructor |
| - | - | - |
| Python | `from zeroruntime.plugins import GradiumTTS` | `GradiumTTS()` |

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.