Skip to main content

Gemini STT

GeminiSTT transcribes with a multimodal Gemini model (gemini-2.5-flash) instead of a dedicated speech recogniser. It buffers the caller’s audio for the whole turn and, at VAD speech-end, sends the utterance as audio. The model returns the transcript and its judgement of how the caller sounded:
The tone prefix flows downstream to the LLM, so the agent can mirror mood — something a words-only transcriber cannot supply.
Turn-based, not streaming. There are no interim partials, and the transcript for a turn arrives one model round-trip after speech-end. Prefer Deepgram, Soniox, or AssemblyAI when turn latency matters more than tone.
Beta. The adapter is validated against the Google Gen AI SDK surface; it has not yet been exercised against a live phone call.

Install

Authentication

GEMINI_API_KEY is read automatically when api_key / apiKey is omitted, with GOOGLE_API_KEY as the second fallback.

Usage

Use the namespaced import (getpatter.stt.gemini) or the flat re-export (GeminiSTT). Both auto-resolve the key from the environment.
Plug it into an agent:

Turn semantics

  • send_audio only buffers. Nothing is uploaded mid-turn.
  • finalize() — fired by the pipeline on VAD speech-end — uploads the whole utterance as a WAV and produces exactly one transcript with is_final and speech_final set.
  • close() flushes a turn that never got a speech-end, so trailing words are not lost.
  • One request per turn is deliberate: tone is judged over the full utterance, and a windowed upload would split one utterance across requests.

Failure behaviour

A model error or an unreachable host is logged at ERROR and yields no transcript — it never raises into the call. A live call degrades to a missed turn rather than dropping.

Options

There is no language option: the model reads the language from the audio itself.

Pricing

Gemini bills audio input at 1.00per1Mtokens∗∗(roughly32tokenspersecondofaudio)plustextoutputat∗∗1.00 per 1M tokens** (roughly 32 tokens per second of audio) plus text output at **2.50 per 1M tokens. Patter records a flat $0.001 per minute preview estimate for this provider. See the Gemini API pricing page for the authoritative numbers.