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

# Gemini

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

Gemini is a **speech-to-text** plugin. It uses Gemini Transcribe with your Gemini API key. Live models stream partial and final transcripts; `gemini-3.5-transcribe` transcribes each turn once it ends and needs voice activity detection. For Google Cloud Speech-to-Text, see [Google STT](https://docs.zeroruntime.ai/runtime-sdk/plugins/stt/google.md).

## Setup

Set your Gemini API key in the worker environment. Generate a key from the [Gemini site](https://aistudio.google.com/apikey):

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

## Usage

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

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

stt = GeminiSTT()

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

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

## Parameters

*Constructor parameters for `GeminiSTT`.*

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | Gemini API key. Falls back to the `GOOGLE_API_KEY` environment variable when unset. |
| `model` | `str` | `"gemini-3.5-transcribe-live"` | Transcribe model, e.g. "gemini-3.5-transcribe-live" for streaming or "gemini-3.5-transcribe" for per-turn transcription. |
| `languages` | `Union[str, list[str], None]` | `"en-US"` | BCP-47 language code or list of codes, e.g. "en-US" or \["hi-IN", "en-IN"]. Set to None to auto-detect the language. |
| `custom_vocabulary` | `list[str] \| None` | `None` | Up to 1,000 words or phrases, such as names and product terms, to recognize more reliably. |
| `interim_results` | `bool` | `True` | Emit partial transcripts while the user is still speaking. Live models only. |
| `mode` | `Literal['verbatim', 'smart'] \| None` | `None` | "verbatim" keeps the exact words; "smart" removes fillers and disfluencies and adds formatting. |
| `start_of_speech_sensitivity` | `Literal['high', 'low'] \| None` | `None` | "high" detects the start of speech sooner; "low" ignores more background noise. Live models only. |
| `end_of_speech_sensitivity` | `Literal['high', 'low'] \| None` | `None` | "high" ends a turn sooner after the speaker stops, for faster final transcripts; "low" waits longer. Live models only. |
| `prefix_padding_ms` | `int \| None` | `None` | Milliseconds of audio kept from just before detected speech, so first syllables are not cut off. Live models only. |
| `silence_duration_ms` | `int \| None` | `None` | Milliseconds of silence before a turn is finalized. Lower is faster but may split sentences at pauses. Live models only. |
| `input_sample_rate` | `int \| None` | `None` | Sample rate of incoming audio in Hz. Leave unset to detect it automatically. |
| `input_channels` | `int \| None` | `None` | Number of channels in the incoming audio. Leave unset to detect it automatically. |

## Import paths

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

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.

## Inference

This provider also runs through the [Inference Gateway](https://docs.zeroruntime.ai/runtime-sdk/plugins/inference/zero-runtime.md) on your Zero Runtime auth token, with no Gemini API key. Import `GeminiSTT` from `zeroruntime.inference` instead of `zeroruntime.plugins`.


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