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

# Gladia

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

Gladia is a **speech-to-text** plugin. It transcribes the caller's audio into text for
the LLM, with support for 90+ languages and automatic code-switching between them.

## Setup

Set your Gladia API key in the worker environment. Generate a key from the [Gladia dashboard](https://app.gladia.io/signup):

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

## Usage

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

<CodeGroup>
  ```python Python theme={null}
  from zeroruntime.plugins import GladiaSTT

  stt = GladiaSTT()

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

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

  const stt = GladiaSTT();

  // Pipeline({ stt, ... })
  ```
</CodeGroup>

## Parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str \| None` | `None` | Gladia API key. Falls back to the `GLADIA_API_KEY` environment variable when unset. |
| `model` | `str` | `"solaria-1"` | Gladia recognition model. `"solaria-1"` is the only production model and the default. |
| `languages` | `List[str] \| None` | `None` | ISO 639-1 language codes to hint at (e.g. `["en", "fr"]`). Only the first element is used. When `None`, the default is `"english"`. |
| `code_switching` | `bool` | `True` | When `True`, language is re-detected on every utterance. When `False`, language is detected once on the first utterance and held for the session. |
| `input_sample_rate` | `int` | `48000` | Sample rate (Hz) of the incoming audio before any resampling. Valid values: `8000`, `16000`, `32000`, `44100`, `48000`. |
| `output_sample_rate` | `int` | `16000` | Sample rate (Hz) forwarded to the Gladia WebSocket session. |
| `encoding` | `str` | `"wav/pcm"` | PCM encoding format sent over the WebSocket. Valid values: `"wav/pcm"`, `"wav/alaw"`, `"wav/ulaw"`. |
| `bit_depth` | `int` | `16` | Bit depth of the PCM samples. Valid values: `8`, `16`, `24`, `32`. |
| `channels` | `int` | `1` | Number of audio channels (1-8). Default is mono. |
| `receive_partial_transcripts` | `bool` | `False` | When `True`, partial (non-final) transcripts are emitted over the WebSocket before the utterance is complete. |

Transcribed text passes to the [LLM](/runtime-sdk/plugins/llm/google) once
[turn detection](/runtime-sdk/plugins/turn-detection/namo) decides the caller has finished speaking.


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