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

# ElevenLabs

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

ElevenLabs is a **speech-to-text** plugin. It uses ElevenLabs Scribe for real-time transcription, a good fit if you already use ElevenLabs voices and want broad language coverage.

## Setup

Set your ElevenLabs API key in the worker environment. Generate a key from the [ElevenLabs site](https://elevenlabs.io/app/settings/api-keys):

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

## Usage

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

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

stt = ElevenLabsSTT()

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

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

const stt = ElevenLabsSTT();

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

## Parameters

*Constructor parameters for `ElevenLabsSTT`.*

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | ElevenLabs API key. Falls back to the `ELEVENLABS_API_KEY` environment variable when unset. |
| `model_id` | `str` | `"scribe_v2_realtime"` | Scribe transcription model, e.g. "scribe\_v2\_realtime". |
| `language_code` | `str` | `"en"` | Language of the speech as an ISO 639 code, e.g. "en" or "es". |
| `sample_rate` | `int \| None` | `None` | Sample rate of incoming audio in Hz, e.g. 8000, 16000 or 48000. Leave unset to detect it automatically. |
| `commit_strategy` | `str` | `"vad"` | How finished transcripts are committed: "vad" ends a segment when the speaker pauses, "manual" waits for an explicit commit. |
| `vad_silence_threshold_secs` | `float` | `0.8` | Seconds of silence that mark the end of speech when committing by voice activity. |
| `vad_threshold` | `float` | `0.4` | Voice activity sensitivity, 0 to 1. Lower values pick up quieter speech. |
| `min_speech_duration_ms` | `int` | `50` | Shortest sound, in milliseconds, that counts as speech. |
| `min_silence_duration_ms` | `int` | `50` | Shortest pause, in milliseconds, that counts as silence. |
| `base_url` | `str` | `"wss://api.elevenlabs.io/v1/speech-to-text/realtime"` | WebSocket URL of the ElevenLabs realtime transcription endpoint. Change it only for a custom or regional endpoint. |
| `detect_language` | `bool` | `False` | Whether to detect the spoken language automatically and report it with transcripts. |
| `interim_results` | `bool` | `True` | Whether partial transcripts are also sent to the client alongside final ones. Turn detection uses partials either way. |

## Import paths

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

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.