LiveKit docs › Build Agents › Models › STT › Gemini

---

# Gemini STT

> How to use Gemini speech-to-text with LiveKit Agents.

## Overview

Gemini speech-to-text is available in LiveKit Agents through [LiveKit Inference](https://docs.livekit.io/agents/models/inference.md) and the [Google plugin](#plugin). With LiveKit Inference, your agent runs on LiveKit's infrastructure to minimize latency. No separate provider API key is required, and usage and rate limits are managed through LiveKit Cloud. Use the plugin instead if you want to manage your own billing and rate limits. Pricing for LiveKit Inference is available on the [pricing page](https://livekit.com/pricing/inference#stt).

The two paths reach different Gemini APIs:

- LiveKit Inference serves Gemini Transcribe Live, a streaming transcription model on the Gemini Live API. It emits interim and final transcripts as the user speaks.
- The plugin transcribes with a Gemini multimodal model through `generate_content`. That API is non-streaming, so each transcript covers a complete segment of speech detected by a VAD.

For a realtime voice pipeline, prefer LiveKit Inference. Use the plugin when you need a specific Gemini model, your own Google credentials, or control over the transcription prompt.

## LiveKit Inference

Use [LiveKit Inference](https://docs.livekit.io/agents/models/inference.md) to access Gemini Transcribe Live without a separate Google API key.

| Model ID | Description |
| google/gemini-3.5-transcribe-live | Streaming transcription on the Gemini Live API. |

Gemini Transcribe Live returns the transcript text and the recognized language. It doesn't return word timings, per-word confidence, or speaker labels.

### Usage

To use Gemini Transcribe Live, use the `STT` class from the `inference` module:

**Python**:

```python
from livekit.agents import AgentSession, inference

session = AgentSession(
    stt=inference.STT(
        model="google/gemini-3.5-transcribe-live",
        language="en"
    ),
    # ... llm, tts, vad, turn_handling, etc.
)

```

---

**Node.js**:

```typescript
import { AgentSession, inference } from '@livekit/agents';

const session = new AgentSession({
    stt: new inference.STT({
        model: "google/gemini-3.5-transcribe-live",
        language: "en"
    }),
    // ... llm, tts, vad, turnHandling, etc.
});

```

### Parameters

- **`model`** _(string)_: The model to use for the STT. See [model IDs](#inference) for available models.

- **`language`** _(LanguageCode)_ (optional): [Language code](https://docs.livekit.io/agents/models/stt.md#language-codes) for the transcription. Leave it unset to let the model identify the language automatically. See [Multilingual transcription](#multilingual).

- **`extra_kwargs`** _(dict)_ (optional): Additional parameters to pass to the model. See [model parameters](#model-parameters) for supported fields. Unrecognized keys are rejected when the session starts.

In Node.js this parameter is called `modelOptions`.

#### Model parameters

Pass the following parameters inside `extra_kwargs` (Python) or `modelOptions` (Node.js):

| Parameter | Type | Notes |
| custom_vocabulary | `list[str]` | Phrases to bias recognition toward, such as product names, proper nouns, and jargon. Up to 1000 entries of up to 200 characters each. |
| language_codes | `list[str]` | BCP-47 codes that limit recognition. This is the multi-language form of `language` and takes precedence over it. Up to 32 entries. |

The following example pins recognition to English and Spanish and biases it toward two product names:

```python
from livekit.agents import AgentSession, inference

session = AgentSession(
    stt=inference.STT(
        model="google/gemini-3.5-transcribe-live",
        extra_kwargs={
            "language_codes": ["en-US", "es-ES"],
            "custom_vocabulary": ["LiveKit", "Agents Playground"],
        },
    ),
    # ... llm, tts, vad, turn_handling, etc.
)

```

### Multilingual transcription

Gemini Transcribe Live identifies the spoken language on its own, and it continues to transcribe when the speaker changes language during the conversation. Leave both `language` and `language_codes` unset to use this behavior.

To limit detection to a known set of languages, pass `language_codes` in `extra_kwargs`. The model still detects the language, but only from the set you give it.

The model supports `ar`, `cs`, `da`, `de`, `el`, `en`, `es`, `fi`, `fr`, `he`, `hi`, `id`, `it`, `ja`, `ko`, `nl`, `no`, `pl`, `pt`, `ru`, `sv`, `th`, `tr`, `uk`, `vi`, and `zh`.

### String descriptors

As a shortcut, you can also pass a [model ID](#inference) string directly to the `stt` argument in your `AgentSession`:

**Python**:

```python
from livekit.agents import AgentSession

session = AgentSession(
    stt="google/gemini-3.5-transcribe-live:en",
    # ... llm, tts, vad, turn_handling, etc.
)

```

---

**Node.js**:

```typescript
import { AgentSession } from '@livekit/agents';

const session = new AgentSession({
    stt: "google/gemini-3.5-transcribe-live:en",
    // ... llm, tts, vad, turnHandling, etc.
});

```

### Regional availability

Gemini Transcribe Live is served from a single global deployment because Google publishes no regional Live API endpoints. A session that pins its inference request to a specific region doesn't route to this model.

## Plugin

LiveKit's plugin support for Google lets you transcribe with a Gemini multimodal model using your own Google credentials.

Available in:
- [ ] Node.js
- [x] Python

### Installation

Install the plugin from PyPI:

```shell
uv add "livekit-agents[google]~=1.8"

```

### Authentication

Authenticate with one of the following methods:

- For the Gemini API, set the `api_key` argument or the `GOOGLE_API_KEY` environment variable.
- For Vertex AI, set `vertexai=True` and name a project with the `project` argument or the `GOOGLE_CLOUD_PROJECT` environment variable. Credentials come from `GOOGLE_APPLICATION_CREDENTIALS` or the `credentials` argument. For more information about mounting files as secrets when deploying to LiveKit Cloud, see [File-mounted secrets](https://docs.livekit.io/deploy/agents/secrets.md#file-mounted-secrets).

### Usage

Use Gemini STT in an `AgentSession` or as a standalone transcription service. For example, you can use this STT in the [Voice AI quickstart](https://docs.livekit.io/agents/start/voice-ai.md).

Gemini transcription is non-streaming, so the session needs a VAD to decide when a segment of speech is complete. `AgentSession` wraps the STT in `StreamAdapter` for you when a VAD is configured:

```python
from livekit.agents import AgentSession, inference
from livekit.plugins import google

session = AgentSession(
    stt=google.STT(
        model="gemini-2.5-flash",
    ),
    vad=inference.VAD(model="silero"),
    # ... llm, tts, etc.
)

```

Without a VAD, the session raises an error. To use the STT outside of an `AgentSession`, wrap it in [`StreamAdapter`](https://docs.livekit.io/agents/models/stt.md#vad-and-streamadapter) yourself.

### Parameters

This section describes the parameters that apply to Gemini transcription. See the [plugin reference](https://docs.livekit.io/reference/python/livekit/plugins/google/index.html.md#livekit.plugins.google.STT) for a complete list of all available parameters.

- **`model`** _(GeminiSTTModels | string)_: The Gemini model to transcribe with. A model name that doesn't start with `gemini-` selects the [Google Cloud STT](https://docs.livekit.io/agents/models/stt/google.md) backend instead.

Supported values are `gemini-3.5-flash`, `gemini-3-pro-preview`, `gemini-3-flash-preview`, `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-2.5-flash-lite`, and `gemini-2.0-flash-001`.

- **`api_key`** _(string)_ (optional) - Environment: `GOOGLE_API_KEY`: Gemini API key. Not used with Vertex AI.

- **`vertexai`** _(bool)_ (optional) - Default: `False`: Whether to use Vertex AI instead of the Gemini API. Falls back to the `GOOGLE_GENAI_USE_VERTEXAI` environment variable.

- **`project`** _(string)_ (optional) - Environment: `GOOGLE_CLOUD_PROJECT`: Google Cloud project to use for Vertex AI.

- **`location`** _(string)_ (optional) - Default: `global`: Google Cloud region to use for Vertex AI, such as `"us-central1"`. The default of `"global"` falls back to the `GOOGLE_CLOUD_LOCATION` environment variable, then to `"us-central1"`.

- **`credentials`** _(Credentials)_ (optional): A `google.auth` credentials object to use for Vertex AI. Ignored for the Gemini API.

- **`languages`** _(LanguageCode)_ (optional) - Default: `en-US`: [Language code](https://docs.livekit.io/agents/models/stt.md#language-codes) for the input audio. The plugin passes the first code to the model as part of the transcription prompt.

- **`prompt`** _(string)_ (optional): Replaces the built-in transcription prompt sent to the model. Use it to change how the model handles disfluencies, formatting, or non-speech audio. The default prompt asks for a verbatim transcript with no commentary or formatting.

- **`temperature`** _(float)_ (optional): Sampling temperature for transcription. Leave it unset to use the model default.

### Unsupported options

The Gemini backend shares the `google.STT` class with Google Cloud STT, but it doesn't accept the Cloud Speech recognition options. The plugin logs a warning and ignores `adaptation`, `keywords`, `denoiser_config`, `endpointing_sensitivity`, `speech_start_timeout`, and `speech_end_timeout`. Word time offsets and `use_streaming` are always off.

A single instance can't switch between the two backends. Passing a model from the other backend to `update_options` raises an error, so create a new `STT` instance instead.

## Additional resources

The following resources provide more information about using Gemini STT with LiveKit Agents.

- **[Gemini audio docs](https://ai.google.dev/gemini-api/docs/audio)**: Gemini Developer API docs for audio understanding.

- **[Voice AI quickstart](https://docs.livekit.io/agents/start/voice-ai.md)**: Get started with LiveKit Agents and Gemini STT.

- **[Google Cloud STT](https://docs.livekit.io/agents/models/stt/google.md)**: Use Chirp and the other Google Cloud STT models instead.

- **[Google ecosystem guide](https://docs.livekit.io/agents/integrations/google.md)**: Overview of the entire Google AI and LiveKit Agents integration.

---

This document was rendered at 2026-10-07T16:26:04.691Z.
For the latest version of this document, see [https://docs.livekit.io/agents/models/stt/gemini.md](https://docs.livekit.io/agents/models/stt/gemini.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).