> ## 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 speech-to-text plugin in a Zero Runtime pipeline. Setup and usage in Python.

Gradium is a **speech-to-text** plugin. It runs realtime transcription, and semantic voice activity detection decides when the user has finished speaking.

## 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 `stt` slot.

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

stt = GradiumSTT()

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

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

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

## Parameters

*Constructor parameters for `GradiumSTT`.*

| 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"` | Realtime transcription model. |
| `language` | `str` | `"en"` | Language of the audio: "en", "fr", "de", "es", "pt", or "any" to detect it. |
| `delay_in_frames` | `int \| None` | `None` | Audio context before text is emitted, in 80 ms frames. Lower is faster, higher is steadier. Leave unset for Gradium's default (10). |
| `temperature` | `float \| None` | `None` | Sampling temperature from 0 to 1.5. Leave unset for Gradium's default. |
| `keywords` | `list[str] \| None` | `None` | Up to 500 single-word names and terms to recognize, e.g. \["Gradium"]. Split multi-word names, and list every spelling you expect. |
| `vad_horizon_s` | `float` | `2.0` | Which of Gradium's semantic VAD predictions ends a turn: how long the user must be expected to stay silent, 0.5, 1, 2 or 3 seconds. Longer is less likely to cut them off. |
| `vad_threshold` | `float` | `0.9` | Probability of that silence, from 0 to 1, that ends the turn. |
| `input_sample_rate` | `int \| None` | `None` | Override the detected input sample rate. Leave unset in normal use. |
| `input_channels` | `int \| None` | `None` | Override the detected input channel count. Leave unset in normal use. |
| `base_url` | `str` | `"wss://api.gradium.ai/api/speech/asr"` | WebSocket endpoint of Gradium realtime speech-to-text. Change only for a proxy or a regional endpoint. |
| `interim_results` | `bool` | `False` | Set to True to also send live partial transcripts to the client. |

## Import paths

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

Transcribed text passes to the [LLM](https://docs.zeroruntime.ai/runtime-sdk/plugins/overview.md) once [turn detection](https://docs.zeroruntime.ai/runtime-sdk/plugins/turn-detection.md) decides the caller has finished speaking.


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