> ## AI Agent Context
> - Full documentation index: https://aistudio.google.com/llms.txt
> - Gemini Docs MCP server (consistent live info): https://gemini-api-docs-mcp.dev
> - Coding agent skills & setup guide: https://aistudio.google.com/docs/coding-agents.md

# Live transcription with Gemini Live API

The Gemini Live API supports low-latency, real-time speech-to-text transcription using the [`gemini-3.5-transcribe-live`](/docs/models/gemini-3.5-transcribe) model. By connecting to the Live API over WebSockets or using the Google Gen AI SDK, you can stream continuous audio input and receive incremental, real-time text transcriptions as speech occurs.

{% button href="https://aistudio.google.com/live?model=gemini-3.5-transcribe-live" icon="mic" variant="primary" %}
  Try Live Transcription in Google AI Studio

{% /button %}

{% button href="https://github.com/google-gemini/cookbook" icon="code" variant="primary" %}
  Open the Colab cookbook

{% /button %}

{% button href="/docs/coding-agents#gemini-live-api-dev" icon="terminal" variant="primary" %}
  Use coding agent skills

{% /button %}

By leveraging the Gemini Live API, developer platforms such as
[Agora](https://docs.agora.io/en/ai/models/asr/gemini),
[Fishjam](https://docs.fishjam.io/tutorials/gemini-live-integration),
[LiveKit](https://docs.livekit.io/agents/models/stt/gemini/),
[Pipecat](https://docs.pipecat.ai/api-reference/server/services/stt/google),
[Vercel](https://vercel.com/docs/ai-gateway/modalities/speech-to-text), and
[Vision Agents](https://visionagents.ai/integrations/stt/gemini)
enable developers to build and deploy high-performance voice-driven interfaces
with ease. These platforms manage complex real-time media streaming
infrastructure behind the scenes, allowing developers to focus entirely on
crafting the user experience.

## Live agent versus live Transcription  {% id="live-agent-versus-live-transcription" %}

While both use the Live API bidirectional streaming connection, Live Transcription operates as a dedicated, low-latency speech recognition pipeline rather than a conversational agent.

| Feature | Live Agent | Live Transcription |
| :--- | :--- | :--- |
| **Primary role** | Conversational assistant that listens, reasons, and speaks back. | Real-time speech-to-text pipeline that transcribes incoming audio. |
| **Response modality** | Spoken audio and text (`response_modalities=["AUDIO"]`). | Streaming text transcriptions (`response_modalities=["TEXT"]`). |
| **Interaction style** | Turn-based dialogue with pause detection and interruptions. | Continuous stream processing as the speaker talks. |
| **Supported features** | Function calling, Google Search, system instructions, input audio transcription with speech biasing (`custom_vocabulary`) on `gemini-3.8-live`. | Speech biasing (`custom_vocabulary`), language detection, manual & hybrid VAD, Smart transcription, voice editing (`source_text`). |
| **Input stream** | Multimodal: audio, video, images, text. | Audio input (raw 16-bit PCM). |

## Get started  {% id="get-started" %}

The following examples demonstrate how to open a bidirectional streaming session with `gemini-3.5-transcribe-live` and receive real-time transcriptions.

{% tabs %}
  {% tab filename="live_transcribe_quickstart.py" label="Python" %}
  ```python
  import asyncio
  from google import genai
  from google.genai import types
  
  client = genai.Client(http_options={"api_version": "v1beta"})
  model = "gemini-3.5-transcribe-live"
  
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      input_audio_transcription=types.AudioTranscriptionConfig(
          language_codes=[],  # Automatic language detection
      ),
  )
  
  async def main():
      async with client.aio.live.connect(model=model, config=config) as session:
          print("Session established with Live Transcription")
  
          # Receive transcription events
          async for response in session.receive():
              server_content = response.server_content
              if server_content and server_content.input_transcription:
                  print("Transcript:", server_content.input_transcription.text)
  
  if __name__ == "__main__":
      asyncio.run(main())
  ```

  {% /tab %}

  {% tab filename="live_transcribe_quickstart.js" label="JavaScript" %}
  ```javascript
  import { GoogleGenAI, Modality } from '@google/genai';
  
  const ai = new GoogleGenAI({ httpOptions: { apiVersion: "v1beta" } });
  const model = 'gemini-3.5-transcribe-live';
  
  const config = {
    responseModalities: [Modality.TEXT],
    inputAudioTranscription: {
      languageCodes: [], // Automatic language detection
    },
  };
  
  async function main() {
    const session = await ai.live.connect({
      model: model,
      config: config,
      callbacks: {
        onopen: () => console.log('Connected to Live Transcription'),
        onmessage: (message) => {
          const content = message.serverContent;
          if (content?.inputTranscription) {
            console.log('Transcript:', content.inputTranscription.text);
          }
        },
        onerror: (e) => console.error('Error:', e.message),
        onclose: (e) => console.log('Connection closed:', e.reason),
      },
    });
  }
  
  await main();
  ```

  {% /tab %}

  {% tab filename="live_transcribe_quickstart_ws.js" label="WebSockets" %}
  ```javascript
  const API_KEY = "YOUR_API_KEY";
  const MODEL_NAME = "gemini-3.5-transcribe-live";
  const WS_URL = `wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?key=${API_KEY}`;
  
  const websocket = new WebSocket(WS_URL);
  
  websocket.onopen = () => {
    console.log('WebSocket connected');
  
    const setupMessage = {
      setup: {
        model: `models/${MODEL_NAME}`,
        generationConfig: {
          responseModalities: ['TEXT'],
        },
        inputAudioTranscription: {
          languageCodes: []
        }
      }
    };
    websocket.send(JSON.stringify(setupMessage));
  };
  
  websocket.onmessage = (event) => {
    const response = JSON.parse(event.data);
    const content = response.serverContent;
    if (content?.inputTranscription) {
      console.log('Transcript:', content.inputTranscription.text);
    }
  };
  ```

  {% /tab %}

{% /tabs %}

## Interim and finalized transcriptions  {% id="interim-transcriptions" %}

As audio streams into the Live API, the server emits two complementary transcription fields within `server_content`:

*   **`interim_input_transcription`**: low-latency, speculative partial hypotheses updated while the speaker is actively talking. These partial updates occur rapidly with minimal delay. Use `interim_input_transcription` to render responsive live UI subtitles or preview captions.
*   **`input_transcription`**: the finalized transcript emitted when the speaker pauses, the turn completes, or speech is finalized. In `"VERBATIM"` mode, this text represents the model's authoritative transcription of that speech segment (which callers append to their transcript buffer). In `"SMART"` mode, this returns the cumulative, cleaned, and formatted transcript for the session so far (which replaces the client's active transcript buffer).

The following example demonstrates how to display streaming interim partials and commit final transcripts:

{% tabs %}
  {% tab filename="live_transcribe_interim.py" label="Python" %}
  ```python
  async def receive_transcripts(session):
      async for response in session.receive():
          server_content = response.server_content
          if not server_content:
              continue
  
          # Real-time interim hypothesis (updates dynamically as user speaks)
          if server_content.interim_input_transcription:
              interim_text = server_content.interim_input_transcription.text
              print(f"\r[Interim] {interim_text}", end="", flush=True)
  
          # Finalized transcript (emitted on speech completion)
          if server_content.input_transcription:
              final_text = server_content.input_transcription.text
              print(f"\n[Final] {final_text}")
  ```

  {% /tab %}

  {% tab filename="live_transcribe_interim.js" label="JavaScript" %}
  ```javascript
  onmessage: (message) => {
    const content = message.serverContent;
    if (!content) return;
  
    if (content.interimInputTranscription) {
      // Update live subtitle preview on screen
      renderInterimPreview(content.interimInputTranscription.text);
    }
  
    if (content.inputTranscription) {
      // Replace active transcript buffer in SMART mode, or append in VERBATIM mode
      commitFinalTranscript(content.inputTranscription.text ?? '');
    }
  };
  ```

  {% /tab %}

  {% tab filename="live_transcribe_interim_ws.js" label="WebSockets" %}
  ```javascript
  websocket.onmessage = (event) => {
    const response = JSON.parse(event.data);
    const content = response.serverContent;
    if (content?.interimInputTranscription) {
      console.log('[Interim]:', content.interimInputTranscription.text);
    }
    if (content?.inputTranscription) {
      console.log('[Final]:', content.inputTranscription.text);
    }
  };
  ```

  {% /tab %}

{% /tabs %}

## Sending audio  {% id="sending-audio" %}

Stream audio chunks over the active connection as raw 16-bit PCM audio.

*   **Audio format:** Raw 16-bit PCM at 16kHz (mono, little-endian).
*   **Chunk size:** Send audio in chunks of 100ms (1,024 to 2,048 frames).
*   **MIME type:** `audio/pcm;rate=16000` (or the matching sample rate).

{% tabs %}
  {% tab filename="live_transcribe_send_audio.py" label="Python" %}
  ```python
  # Stream a raw PCM audio chunk
  await session.send_realtime_input(
      audio=types.Blob(
          data=audio_chunk_bytes,
          mime_type="audio/pcm;rate=16000"
      )
  )
  
  # Signal the end of the audio stream when finished
  await session.send_realtime_input(audio_stream_end=True)
  ```

  {% /tab %}

  {% tab filename="live_transcribe_send_audio.js" label="JavaScript" %}
  ```javascript
  // Send base64-encoded PCM audio chunk
  session.sendRealtimeInput({
    audio: {
      data: audioChunkBase64,
      mimeType: 'audio/pcm;rate=16000'
    }
  });
  
  // Signal stream end
  session.sendRealtimeInput({
    audioStreamEnd: true
  });
  ```

  {% /tab %}

  {% tab filename="live_transcribe_send_audio_ws.js" label="WebSockets" %}
  ```javascript
  // Send base64-encoded PCM audio chunk
  websocket.send(JSON.stringify({
    realtimeInput: {
      audio: {
        data: audioChunkBase64,
        mimeType: 'audio/pcm;rate=16000'
      }
    }
  }));
  
  // Signal stream end
  websocket.send(JSON.stringify({
    realtimeInput: {
      audioStreamEnd: true
    }
  }));
  ```

  {% /tab %}

{% /tabs %}

## Transcription features  {% id="transcription-features" %}

### Automatic language detection  {% id="automatic-language-detection" %}

By default, omitting `language_codes` or setting `language_codes=[]` enables automatic language identification. The model dynamically detects the spoken language across utterances, including multilingual conversations and code-switching.

{% tabs %}
  {% tab filename="live_transcribe_auto_lang.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      input_audio_transcription=types.AudioTranscriptionConfig(
          language_codes=[],
      ),
  )
  ```

  {% /tab %}

  {% tab filename="live_transcribe_auto_lang.js" label="JavaScript" %}
  ```javascript
  const config = {
    responseModalities: [Modality.TEXT],
    inputAudioTranscription: {
      languageCodes: [],
    },
  };
  ```

  {% /tab %}

  {% tab filename="live_transcribe_auto_lang_ws.js" label="WebSockets" %}
  ```javascript
  const setupMessage = {
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      inputAudioTranscription: {
        languageCodes: [],
      },
    },
  };
  websocket.send(JSON.stringify(setupMessage));
  ```

  {% /tab %}

{% /tabs %}

### Specific language hint  {% id="specific-language-hint" %}

Provide explicit BCP-47 language codes (for example, `["es-ES"]` for Spanish or `["fr-FR"]` for French) to bias recognition toward specific languages (see [Supported languages](/docs/live-api/live-transcribe#supported-languages)).

{% tabs %}
  {% tab filename="live_transcribe_lang_hint.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      input_audio_transcription=types.AudioTranscriptionConfig(
          language_codes=["es-ES"],
      ),
  )
  ```

  {% /tab %}

  {% tab filename="live_transcribe_lang_hint.js" label="JavaScript" %}
  ```javascript
  const config = {
    responseModalities: [Modality.TEXT],
    inputAudioTranscription: {
      languageCodes: ['es-ES'],
    },
  };
  ```

  {% /tab %}

  {% tab filename="live_transcribe_lang_hint_ws.js" label="WebSockets" %}
  ```javascript
  const setupMessage = {
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      inputAudioTranscription: {
        languageCodes: ['es-ES'],
      },
    },
  };
  websocket.send(JSON.stringify(setupMessage));
  ```

  {% /tab %}

{% /tabs %}

### Custom vocabulary biasing  {% id="custom-vocabulary-biasing" %}

Provide a list of up to 1,000 phrases, proper nouns, brand names, or technical terms in `custom_vocabulary` to bias speech recognition toward specific terminology (best results are typically achieved with up to 100 terms).

{% tabs %}
  {% tab filename="live_transcribe_custom_vocab.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      input_audio_transcription=types.AudioTranscriptionConfig(
          language_codes=[],
          custom_vocabulary=["Gemini", "Kubernetes", "BigQuery"],
      ),
  )
  ```

  {% /tab %}

  {% tab filename="live_transcribe_custom_vocab.js" label="JavaScript" %}
  ```javascript
  const config = {
    responseModalities: [Modality.TEXT],
    inputAudioTranscription: {
      languageCodes: [],
      customVocabulary: ['Gemini', 'Kubernetes', 'BigQuery'],
    },
  };
  ```

  {% /tab %}

  {% tab filename="live_transcribe_custom_vocab_ws.js" label="WebSockets" %}
  ```javascript
  const setupMessage = {
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      inputAudioTranscription: {
        languageCodes: [],
        customVocabulary: ['Gemini', 'Kubernetes', 'BigQuery'],
      },
    },
  };
  websocket.send(JSON.stringify(setupMessage));
  ```

  {% /tab %}

{% /tabs %}

### Smart transcription  {% id="smart-transcription" %}

Configure transcription output formatting using the `mode` parameter in `input_audio_transcription`:

*   **`VERBATIM` (default)**: Produces an exact literal transcript of everything spoken, preserving raw filler words ("um", "uh", "like"), repetitions, and false starts.
*   **`SMART` (Smart transcription)**: Cleans up and structures the transcript for readability:
    *   **Disfluency removal**: Removes filler words, stuttering, and false starts.
    *   **Inline self-corrections**: Resolves spoken corrections naturally.
    *   **Structured formatting**: Automatically formats lists, bullet points, numbers, dates, and paragraph breaks.
    *   **Grammar & casing**: Applies natural capitalization and punctuation polish.
    *   **Voice editing (enabled by default)**: Applies spoken editing, rewriting, and formatting commands across turns, optionally seeded with existing `source_text`.


{% tabs %}
  {% tab filename="live_transcribe_smart_mode.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      input_audio_transcription=types.AudioTranscriptionConfig(
          mode="SMART",
      ),
  )
  ```

  {% /tab %}

  {% tab filename="live_transcribe_smart_mode.js" label="JavaScript" %}
  ```javascript
  const config = {
    responseModalities: [Modality.TEXT],
    inputAudioTranscription: {
      mode: 'SMART',
    },
  };
  ```

  {% /tab %}

  {% tab filename="live_transcribe_smart_mode_ws.js" label="WebSockets" %}
  ```javascript
  const setupMessage = {
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      inputAudioTranscription: {
        mode: 'SMART',
      },
    },
  };
  websocket.send(JSON.stringify(setupMessage));
  ```

  {% /tab %}

{% /tabs %}

{% callout type="warning" %}
  When switching to `mode: "SMART"`, `server_content.input_transcription.text` returns the **entire cumulative session transcript so far** on each turn rather than a per-segment delta. Update your client to **replace** its active transcript buffer with each finalized `input_transcription` instead of appending, or earlier turns will be duplicated.

{% /callout %}

### Voice editing  {% id="voice-editing" %}

Voice editing is enabled by default whenever Smart transcription mode (`mode: "SMART"`) is active in `input_audio_transcription`. Across a session, the server maintains an active text context and applies spoken editing, formatting, or rewriting instructions to that text, emitting the complete replacement text in `server_content.input_transcription`.

You can start a voice editing session from an empty text box (by setting only `mode: "SMART"`) or pre-populate existing reference text using the optional `source_text` field (up to 64 KiB). Note that `interim_input_transcription` streams the literal spoken instruction while the user is talking; wait for `input_transcription` before updating your document buffer, and treat an unset `input_transcription.text` (e.g., after `"Delete everything"`) as `""`.

#### Enable voice editing  {% id="enable-voice-editing" %}

Setting `mode` to `"SMART"` in `input_audio_transcription` enables voice editing by default across turns. If you want the user's spoken instructions to edit pre-existing text from the first turn, pass that text in `source_text` (up to 64 KiB) during session setup.

{% callout type="tip" %}
  Pair voice editing with [Manual VAD (Push-to-Talk)](/docs/live-api/live-transcribe#manual-vad-push-to-talk) (`automatic_activity_detection.disabled = True` with explicit `activity_start` and `activity_end` signals) so natural pauses while thinking through an edit instruction do not split the turn early.

{% /callout %}

{% tabs %}
  {% tab filename="live_transcribe_voice_edit.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      realtime_input_config=types.RealtimeInputConfig(
          automatic_activity_detection=types.AutomaticActivityDetection(
              disabled=True
          )
      ),
      input_audio_transcription=types.AudioTranscriptionConfig(
          mode="SMART",  # Voice editing is enabled by default in SMART mode
          # Optional: pre-populate existing text to edit on the first turn
          source_text="The meeting is at 2:00 PM tomorrow in building 42.",
      ),
  )
  ```

  {% /tab %}

  {% tab filename="live_transcribe_voice_edit.js" label="JavaScript" %}
  ```javascript
  const config = {
    responseModalities: [Modality.TEXT],
    realtimeInputConfig: {
      automaticActivityDetection: {
        disabled: true,
      },
    },
    inputAudioTranscription: {
      mode: 'SMART', // Voice editing is enabled by default in SMART mode
      // Optional: pre-populate existing text to edit on the first turn
      sourceText: 'The meeting is at 2:00 PM tomorrow in building 42.',
    },
  };
  ```

  {% /tab %}

  {% tab filename="live_transcribe_voice_edit_ws.js" label="WebSockets" %}
  ```javascript
  const setupMessage = {
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      realtimeInputConfig: {
        automaticActivityDetection: {
          disabled: true,
        },
      },
      inputAudioTranscription: {
        mode: 'SMART', // Voice editing is enabled by default in SMART mode
        // Optional: pre-populate existing text to edit on the first turn
        sourceText: 'The meeting is at 2:00 PM tomorrow in building 42.',
      },
    },
  };
  websocket.send(JSON.stringify(setupMessage));
  ```

  {% /tab %}

{% /tabs %}

#### Voice edit prompt examples  {% id="voice-edit-prompt-examples" %}

Voice editing supports targeted replacements, tone adjustments, list formatting, appending new dictated text, and deletions:

{% table %}
  * Edit type
  * Active `source_text`
  * Spoken audio prompt
  * Output (`input_transcription.text`)

  ---

  * **Targeted replacement**
  * "The meeting is at 2:00 PM tomorrow in building 42."
  * "Change the time to 3:30 PM and mention video conferencing is available."
  * "The meeting is at 3:30 PM tomorrow in building 42, with video conferencing available."

  ---

  * **Tone and style transfer**
  * "The new park downtown is finally open, and I've heard it has some really cool features."
  * "Make it sound more formal."
  * "The new downtown park has officially opened and reportedly features several impressive amenities."

  ---

  * **Structural formatting**
  * "We need to review the Q3 budget, finalize the launch timeline, and send the recap email."
  * "Format the action items as a numbered list."
  * We need to:    1. Review the Q3 budget
    2. Finalize the launch timeline
    3. Send the recap email


  ---

  * **Appending dictation**
  * "Hi Alex, thanks for sending over the design doc."
  * "Add a sentence asking if we can review the latency numbers tomorrow morning."
  * "Hi Alex, thanks for sending over the design doc. Can we review the latency numbers tomorrow morning?"

  ---

  * **Deletion**
  * "Let's schedule the sync for Monday afternoon. We also need to invite the security team."
  * "Delete the second sentence."
  * "Let's schedule the sync for Monday afternoon."
{% /table %}

#### Multi-turn voice editing  {% id="multi-turn-voice-editing" %}

When `mode` is set to `"SMART"`, Live transcription sessions maintain and propagate the active text context across turns by default—both when starting from an empty text box (`source_text` omitted) and when seeding initial text with `source_text`:

1.  **Session setup**: Set `mode: "SMART"` in `input_audio_transcription`. Optionally provide initial `source_text` if the user is editing pre-existing text; if `source_text` is omitted, the session starts with an empty text context by default.
2.  **First turn**: If `source_text` was omitted, the first spoken turn dictates initial text (and applies any inline edits). If `source_text` was provided, the first spoken turn edits that initial `source_text`. In either case, the server emits the complete resulting text in `server_content.input_transcription`.
3.  **Subsequent turns**: After each finalized turn, the server automatically advances the active text context to the previous turn's finalized `input_transcription`. Each new spoken turn in the same session edits or appends to the latest text without reconnecting or resending `source_text`. Note that `source_text` is only accepted during session setup—if a user makes manual keyboard edits mid-session, reconnect with the updated `source_text` to sync state.

For example, across a multi-turn session seeded with `source_text`:

*   **Initial `source_text` in setup**: `"The new park downtown is finally open, and I've heard it has some really cool features."` (Or if `source_text` was omitted in setup, the user dictates this sentence in an initial turn.)
*   **Turn 1 spoken audio**: `"Make it more professional."`
    *   **Turn 1 `input_transcription.text`**: `"The new downtown park has officially opened and features several impressive amenities."`

*   **Turn 2 spoken audio**: `"Add a sentence inviting the team to visit on Friday."`
    *   **Turn 2 `input_transcription.text`**: `"The new downtown park has officially opened and features several impressive amenities. Please join the team for a visit this Friday."`


{% tabs %}
  {% tab filename="live_transcribe_voice_edit_multiturn.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      realtime_input_config=types.RealtimeInputConfig(
          automatic_activity_detection=types.AutomaticActivityDetection(
              disabled=True
          )
      ),
      input_audio_transcription=types.AudioTranscriptionConfig(
          mode="SMART",
          source_text="The new park downtown is finally open, and I've heard it has some really cool features.",
      ),
  )
  
  async with client.aio.live.connect(model=model, config=config) as session:
      # Turn 1: edits the initial source_text ("Make it more professional.")
      await session.send_realtime_input(activity_start=types.ActivityStart())
      for chunk in turn1_pcm_chunks:
          await session.send_realtime_input(
              audio=types.Blob(data=chunk, mime_type="audio/pcm;rate=16000")
          )
      await session.send_realtime_input(activity_end=types.ActivityEnd())
  
      async for response in session.receive():
          sc = response.server_content
          if sc and sc.input_transcription:
              print("Turn 1 result:", sc.input_transcription.text or "")
          if sc and (sc.generation_complete or sc.turn_complete):
              break
  
      # Turn 2: automatically edits Turn 1's finalized output
      # ("Add a sentence inviting the team to visit on Friday.")
      await session.send_realtime_input(activity_start=types.ActivityStart())
      for chunk in turn2_pcm_chunks:
          await session.send_realtime_input(
              audio=types.Blob(data=chunk, mime_type="audio/pcm;rate=16000")
          )
      await session.send_realtime_input(activity_end=types.ActivityEnd())
  
      async for response in session.receive():
          sc = response.server_content
          if sc and sc.input_transcription:
              print("Turn 2 result:", sc.input_transcription.text or "")
          if sc and (sc.generation_complete or sc.turn_complete):
              break
  ```

  {% /tab %}

  {% tab filename="live_transcribe_voice_edit_multiturn.js" label="JavaScript" %}
  ```javascript
  let resolveTurnDone;
  const waitForTurn = () => new Promise((resolve) => { resolveTurnDone = resolve; });
  
  const session = await ai.live.connect({
    model,
    config: {
      responseModalities: [Modality.TEXT],
      realtimeInputConfig: {
        automaticActivityDetection: {
          disabled: true,
        },
      },
      inputAudioTranscription: {
        mode: 'SMART',
        sourceText:
          "The new park downtown is finally open, and I've heard it has some really cool features.",
      },
    },
    callbacks: {
      onmessage: (message) => {
        const sc = message.serverContent;
        if (sc?.inputTranscription) {
          console.log('Result:', sc.inputTranscription.text ?? '');
        }
        if (sc?.generationComplete || sc?.turnComplete) {
          resolveTurnDone?.();
        }
      },
    },
  });
  
  // Turn 1: edits the initial sourceText ("Make it more professional.")
  let turnDone = waitForTurn();
  session.sendRealtimeInput({ activityStart: {} });
  for (const chunkBase64 of turn1Chunks) {
    session.sendRealtimeInput({
      audio: { data: chunkBase64, mimeType: 'audio/pcm;rate=16000' },
    });
  }
  session.sendRealtimeInput({ activityEnd: {} });
  await turnDone;
  
  // Turn 2: after Turn 1 completes, Turn 2 automatically edits Turn 1's
  // finalized transcript without resending sourceText
  turnDone = waitForTurn();
  session.sendRealtimeInput({ activityStart: {} });
  for (const chunkBase64 of turn2Chunks) {
    session.sendRealtimeInput({
      audio: { data: chunkBase64, mimeType: 'audio/pcm;rate=16000' },
    });
  }
  session.sendRealtimeInput({ activityEnd: {} });
  await turnDone;
  ```

  {% /tab %}

  {% tab filename="live_transcribe_voice_edit_multiturn_ws.js" label="WebSockets" %}
  ```javascript
  let resolveTurnDone;
  const waitForTurn = () => new Promise((resolve) => { resolveTurnDone = resolve; });
  
  websocket.onmessage = (event) => {
    const sc = JSON.parse(event.data).serverContent;
    if (sc?.inputTranscription) {
      console.log('Result:', sc.inputTranscription.text ?? '');
    }
    if (sc?.generationComplete || sc?.turnComplete) {
      resolveTurnDone?.();
    }
  };
  
  // 1. Seed initial sourceText once in the setup message
  websocket.send(JSON.stringify({
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      realtimeInputConfig: {
        automaticActivityDetection: {
          disabled: true,
        },
      },
      inputAudioTranscription: {
        mode: 'SMART',
        sourceText:
          "The new park downtown is finally open, and I've heard it has some really cool features.",
      },
    },
  }));
  
  // 2. Turn 1: edits the initial sourceText
  let turnDone = waitForTurn();
  websocket.send(JSON.stringify({ realtimeInput: { activityStart: {} } }));
  websocket.send(JSON.stringify({
    realtimeInput: {
      audio: { data: turn1ChunkBase64, mimeType: 'audio/pcm;rate=16000' },
    },
  }));
  websocket.send(JSON.stringify({ realtimeInput: { activityEnd: {} } }));
  await turnDone;
  
  // 3. Turn 2: after Turn 1 completes, the next spoken turn
  // automatically operates on Turn 1's finalized output
  turnDone = waitForTurn();
  websocket.send(JSON.stringify({ realtimeInput: { activityStart: {} } }));
  websocket.send(JSON.stringify({
    realtimeInput: {
      audio: { data: turn2ChunkBase64, mimeType: 'audio/pcm;rate=16000' },
    },
  }));
  websocket.send(JSON.stringify({ realtimeInput: { activityEnd: {} } }));
  await turnDone;
  ```

  {% /tab %}

{% /tabs %}

## Voice Activity Detection (VAD) strategies  {% id="voice-activity-detection-vad-strategies" %}

### Automatic VAD (Default)  {% id="automatic-vad-default" %}

By default, server-side automatic Voice Activity Detection detects when a speaker begins and stops speaking.

### Hybrid VAD  {% id="hybrid-vad" %}

[Hybrid VAD](/docs/live-api/capabilities#hybrid-vad) combines server-side automatic speech start detection with client-side speech end detection for zero-latency turn finalization:

1.  **Server-side automatic VAD remains enabled** to detect speech beginnings accurately with prefix audio padding, preventing front-word truncation.
2.  **Client-side VAD detects silence**: When a local on-device VAD detects that the speaker has stopped talking, the client sends an `audio_stream_end` signal immediately.
3.  **Fast finalization**: The server treats `audio_stream_end` as an immediate turn finalization prompt, bypassing the default server-side silence wait time and returning the finalized transcript with minimal latency.
4.  **Fallback**: If the client VAD fails to trigger, the server-side VAD acts as an automatic fallback.

{% tabs %}
  {% tab filename="live_transcribe_hybrid_vad.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      input_audio_transcription=types.AudioTranscriptionConfig(),
  )
  
  async with client.aio.live.connect(model=model, config=config) as session:
      # Stream audio chunks...
      await session.send_realtime_input(
          audio=types.Blob(data=chunk, mime_type="audio/pcm;rate=16000")
      )
  
      # When client-side VAD detects end of speech, send audio_stream_end:
      await session.send_realtime_input(audio_stream_end=True)
  ```

  {% /tab %}

  {% tab filename="live_transcribe_hybrid_vad.js" label="JavaScript" %}
  ```javascript
  const config = {
    responseModalities: [Modality.TEXT],
    inputAudioTranscription: {},
  };
  
  // Stream audio...
  session.sendRealtimeInput({
    audio: { data: chunkBase64, mimeType: 'audio/pcm;rate=16000' }
  });
  
  // When client VAD detects end of speech, send audioStreamEnd:
  session.sendRealtimeInput({
    audioStreamEnd: true
  });
  ```

  {% /tab %}

  {% tab filename="live_transcribe_hybrid_vad_ws.js" label="WebSockets" %}
  ```javascript
  const setupMessage = {
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      inputAudioTranscription: {},
    },
  };
  websocket.send(JSON.stringify(setupMessage));
  
  // Stream audio...
  websocket.send(JSON.stringify({
    realtimeInput: {
      audio: { data: chunkBase64, mimeType: 'audio/pcm;rate=16000' }
    }
  }));
  
  // When client VAD detects end of speech, send audioStreamEnd:
  websocket.send(JSON.stringify({
    realtimeInput: {
      audioStreamEnd: true
    }
  }));
  ```

  {% /tab %}

{% /tabs %}

### Manual VAD (Push-to-Talk)  {% id="manual-vad-push-to-talk" %}

For walkie-talkie interfaces or push-to-talk buttons, disable automatic VAD entirely and control turn boundaries explicitly using `activity_start` and `activity_end`:

{% tabs %}
  {% tab filename="live_transcribe_manual_vad.py" label="Python" %}
  ```python
  config = types.LiveConnectConfig(
      response_modalities=["TEXT"],
      realtime_input_config=types.RealtimeInputConfig(
          automatic_activity_detection=types.AutomaticActivityDetection(
              disabled=True
          )
      ),
      input_audio_transcription=types.AudioTranscriptionConfig(),
  )
  
  async with client.aio.live.connect(model=model, config=config) as session:
      # Button pressed: signal speech start
      await session.send_realtime_input(activity_start=types.ActivityStart())
  
      # Stream audio chunks...
      await session.send_realtime_input(audio=types.Blob(data=chunk, mime_type="audio/pcm;rate=16000"))
  
      # Button released: signal speech end
      await session.send_realtime_input(activity_end=types.ActivityEnd())
  ```

  {% /tab %}

  {% tab filename="live_transcribe_manual_vad.js" label="JavaScript" %}
  ```javascript
  const config = {
    responseModalities: [Modality.TEXT],
    realtimeInputConfig: {
      automaticActivityDetection: {
        disabled: true,
      },
    },
    inputAudioTranscription: {},
  };
  
  // Signal speech start
  session.sendRealtimeInput({ activityStart: {} });
  
  // Stream audio...
  
  // Signal speech end
  session.sendRealtimeInput({ activityEnd: {} });
  ```

  {% /tab %}

  {% tab filename="live_transcribe_manual_vad_ws.js" label="WebSockets" %}
  ```javascript
  const setupMessage = {
    setup: {
      model: 'models/gemini-3.5-transcribe-live',
      generationConfig: {
        responseModalities: ['TEXT'],
      },
      realtimeInputConfig: {
        automaticActivityDetection: {
          disabled: true,
        },
      },
      inputAudioTranscription: {},
    },
  };
  websocket.send(JSON.stringify(setupMessage));
  
  // Button pressed: signal speech start
  websocket.send(JSON.stringify({
    realtimeInput: {
      activityStart: {},
    },
  }));
  
  // Stream audio...
  websocket.send(JSON.stringify({
    realtimeInput: {
      audio: { data: chunkBase64, mimeType: 'audio/pcm;rate=16000' },
    },
  }));
  
  // Button released: signal speech end
  websocket.send(JSON.stringify({
    realtimeInput: {
      activityEnd: {},
    },
  }));
  ```

  {% /tab %}

{% /tabs %}

## Ephemeral tokens in client applications  {% id="ephemeral-tokens-in-client-applications" %}

For client-to-server applications (such as mobile or web apps streaming directly from a microphone), use [ephemeral tokens](/docs/live-api/ephemeral-tokens) to avoid exposing your API key in client code.

Create a constrained ephemeral token on your server before initiating the client connection:

{% tabs %}
  {% tab filename="live_transcribe_ephemeral_token.py" label="Python" %}
  ```python
  import datetime
  from google import genai
  
  client = genai.Client(http_options={"api_version": "v1beta"})
  expire_time = datetime.datetime.now(tz=datetime.timezone.utc) + datetime.timedelta(minutes=30)
  
  token = client.auth_tokens.create(
      config={
          "uses": 1,
          "expire_time": expire_time,
          "live_connect_constraints": {
              "model": "gemini-3.5-transcribe-live",
              "config": {
                  "response_modalities": ["TEXT"],
                  "input_audio_transcription": {
                      "language_codes": [],
                  },
              },
          },
      }
  )
  ```

  {% /tab %}

  {% tab filename="live_transcribe_ephemeral_token.js" label="JavaScript" %}
  ```javascript
  import { GoogleGenAI } from '@google/genai';
  
  const client = new GoogleGenAI({ httpOptions: { apiVersion: "v1beta" } });
  const expireTime = new Date(Date.now() + 30 * 60 * 1000).toISOString();
  
  const token = await client.authTokens.create({
    config: {
      uses: 1,
      expireTime: expireTime,
      liveConnectConstraints: {
        model: 'gemini-3.5-transcribe-live',
        config: {
          responseModalities: ['TEXT'],
          inputAudioTranscription: {
            languageCodes: [],
          },
        },
      },
    },
  });
  ```

  {% /tab %}

  {% tab filename="live_transcribe_ephemeral_token.sh" label="REST" %}
  ```bash
  curl -X POST "https://generativelanguage.googleapis.com/v1beta/auth_tokens" \
    -H "x-goog-api-key: ${GEMINI_API_KEY}" \
    -H "Content-Type: application/json" \
    -d '{
      "uses": 1,
      "expireTime": "YYYY-MM-DDTHH:MM:SSZ",
      "liveConnectConstraints": {
        "model": "models/gemini-3.5-transcribe-live",
        "config": {
          "responseModalities": ["TEXT"],
          "inputAudioTranscription": {
            "languageCodes": []
          }
        }
      }
    }'
  ```

  {% /tab %}

{% /tabs %}

## Supported languages  {% id="supported-languages" %}

The following languages and BCP-47 language codes are supported for Gemini 3.5 Transcribe Live:

| Language | BCP-47 Code | Language | BCP-47 Code |
| :--- | :--- | :--- | :--- |
| Afrikaans | `af-ZA` | Japanese | `ja-JP` |
| Amharic | `am-ET` | Javanese | `jv-ID` |
| Arabic (Egypt) | `ar-EG` | Kabuverdianu | `kea-CV` |
| Armenian | `hy-AM` | Kannada | `kn-IN` |
| Assamese | `as-IN` | Kazakh | `kk-KZ` |
| Azerbaijani | `az-AZ` | Korean | `ko-KR` |
| Belarusian | `be-BY` | Kyrgyz | `ky-KG` |
| Bengali (Bangladesh) | `bn-BD` | Latvian | `lv-LV` |
| Bengali (India) | `bn-IN` | Lingala | `ln-CD` |
| Bosnian | `bs-BA` | Lithuanian | `lt-LT` |
| Bulgarian | `bg-BG` | Macedonian | `mk-MK` |
| Bulgarian (Aromanian) | `rup-BG` | Malay | `ms-MY` |
| Burmese | `my-MM` | Malayalam | `ml-IN` |
| Cantonese (Traditional) | `yue-Hant-HK` | Maltese | `mt-MT` |
| Catalan | `ca-ES` | Mandarin Chinese (Simplified) | `cmn-Hans-CN` |
| Cebuano | `ceb` | Marathi | `mr-IN` |
| Central Khmer | `km-KH` | Mongolian | `mn-MN` |
| Croatian | `hr-HR` | Nepali | `ne-NP` |
| Czech | `cs-CZ` | Norwegian | `nb-NO` |
| Danish | `da-DK` | Oriya | `or-IN` |
| Dutch | `nl-NL` | Polish | `pl-PL` |
| English (Great Britain) | `en-GB` | Portuguese (Brazil) | `pt-BR` |
| English (India) | `en-IN` | Portuguese (Portugal) | `pt-PT` |
| English (United States) | `en-US` | Punjabi | `pa-IN` |
| Estonian | `et-EE` | Punjabi (Gurmukhi script) | `pa-Guru-IN` |
| Farsi | `fa-IR` | Romanian | `ro-RO` |
| Filipino | `fil-PH` | Russian | `ru-RU` |
| Finnish | `fi-FI` | Serbian | `sr-RS` |
| French | `fr-FR` | Sindhi (Arabic script) | `sd-Arab-IN` |
| Galician | `gl-ES` | Slovak | `sk-SK` |
| Georgian | `ka-GE` | Slovenian | `sl-SI` |
| German | `de-DE` | Spanish (Latin America) | `es-419` |
| Greek | `el-GR` | Spanish (United States) | `es-US` |
| Gujarati | `gu-IN` | Swahili (Kenya) | `sw-KE` |
| Hausa | `ha-NG` | Swedish | `sv-SE` |
| Hebrew | `he-IL` | Tajik | `tg-TJ` |
| Hindi | `hi-IN` | Telugu | `te-IN` |
| Hungarian | `hu-HU` | Thai | `th-TH` |
| Icelandic | `is-IS` | Turkish | `tr-TR` |
| Indian English | `en-IN` | Ukrainian | `uk-UA` |
| Indonesian | `id-ID` | Uzbek | `uz-UZ` |
| Italian | `it-IT` | Vietnamese | `vi-VN` |

## Parameter reference  {% id="parameter-reference" %}

Configure live transcription using fields in `input_audio_transcription` and `realtime_input_config`:

| Parameter | Type | Description |
| :--- | :--- | :--- |
| `language_codes` | Array of strings | BCP-47 language codes (e.g., `["en-US"]`). If omitted or empty (`[]`), the model automatically detects the language and handles multilingual speech. |
| `custom_vocabulary` | Array of strings | Up to 1,000 custom terms, acronyms, brand names, or proper nouns to bias speech recognition. |
| `mode` | String | Transcription mode: `"VERBATIM"` (default) or `"SMART"` (Smart transcription). When set to `"SMART"`, the model removes filler words, formats lists, corrects disfluencies, and enables voice editing across turns by default. |
| `source_text` | String | *(Smart mode only)* Optional initial reference text (up to 64 KiB) to edit, rewrite, or format using spoken voice instructions. Requires `mode` to be set to `"SMART"`. Automatically updates to the previous turn's finalized transcript across multi-turn sessions. |
| `automatic_activity_detection.disabled` | Boolean | Set to `true` to disable automatic voice activity detection and manually send `activityStart` and `activityEnd` signals. |

### Server response fields  {% id="server-response-fields" %}

| Field | Description |
| :--- | :--- |
| `server_content.interim_input_transcription` | Low-latency, interim partial transcription hypothesis emitted continuously while the user is actively speaking. In `"SMART"` mode, streams the literal spoken instruction rather than the edited document, so do not overwrite your active document buffer with interim text. |
| `server_content.input_transcription` | Finalized, authoritative input transcript emitted when a speech turn finishes. In `"SMART"` mode, contains the complete updated replacement text for the session so far (replacing prior turns' text, unlike `"VERBATIM"` which emits only the current speech segment). If a voice edit clears all text, `text` is unset (treat as `""`). |

## Limitations  {% id="limitations" %}

*   **Session duration:** Live transcription sessions support continuous streaming for up to 10 minutes.
*   **Speaker diarization:** Speaker diarization is not supported in live streaming sessions. For speaker diarization, use the non-streaming [Audio transcription](/docs/transcribe#speaker-diarization) endpoint.
*   **Word-level timestamps:** Word-level timestamps are not supported over the Live API. The Live API emits utterance-level timestamps (`interim_input_transcription` and `input_transcription`).
*   **Custom vocabulary:** You can provide up to 1,000 terms in `custom_vocabulary`, but best results are typically achieved with up to 100 terms.
*   **Mode compatibility:** Smart transcription (`"mode": "SMART"`) removes filler words and formats intent-aware text, but cannot be combined with word annotations.
*   **Voice editing (`source_text`):** Voice editing across turns is enabled by default when `mode` is set to `"SMART"`. Passing initial `source_text` is supported only on `input_audio_transcription` when `mode` is explicitly set to `"SMART"`, with a maximum `source_text` size of 64 KiB (65,536 bytes).

## What's next  {% id="whats-next" %}

*   Read the [Gemini Transcribe documentation](/docs/transcribe) for non-streaming audio files.
*   Read the [Live API overview](/docs/live-api) for conversational voice agents.
*   Read the [Live translation guide](/docs/live-api/live-translate) for real-time speech-to-speech translation.
*   Check the [Pricing page](/docs/pricing#gemini-3.5-transcribe-live) for Live API streaming pricing.
*   Explore the [Live API capabilities guide](/docs/live-api/capabilities).

