/gemini-skills:gemini-live-api-devfrom gemini-skills
Builds real-time bidirectional streaming apps with Gemini Live API over WebSockets. Covers audio/video/text streaming, VAD, function calling, session management, ephemeral tokens, live transcription, translation, and migration from legacy Live models.
Ships in gemini-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Live API enables low-latency, real-time voice and video interactions with Gemini over WebSockets. It processes continuous streams of audio, video, or text to deliver immediate, human-like spoken responses and background reasoning.
Key capabilities:
MINIMAL) or multi-step background reasoning (LOW/MEDIUM/HIGH) with spoken updates on gemini-4-livesystem_instruction and tools without reconnecting[!NOTE] The Live API connects directly via WebSockets. For WebRTC support or simplified integration, use a partner integration.
gemini-4-live — Unified model replacing both gemini-3.8-live and gemini-3.8-live-extended-thinking on a single endpoint (128K input / 64K output context window).
thinking_level or set "minimal" / MINIMAL): Lowest latency (>3x faster Time to First Audio than gemini-3.8-live), standard turn_complete lifecycle, supports both NON_BLOCKING (default) and explicit BLOCKING function declarations plus function response scheduling (SILENT, WHEN_IDLE, INTERRUPT).thinking_level set to "low", "medium", or "high" / LOW, MEDIUM, HIGH): Runs background reasoning while speaking conversational updates. Requires behavior: "NON_BLOCKING" on all function declarations (BLOCKING and scheduling return errors), and clients must track server_content.interaction_status (IN_PROGRESS vs IDLE).thinking_budget and XHIGH are not supported.gemini-4-live-translate — Real-time speech-to-speech streaming translation across 70+ languages (4,900+ language pairs), starting in under 2 seconds (~2x faster than gemini-3.5-live-translate-preview), with improved speaker echo handling (16K input / 32K output context window). Supports translation_config, optional setup-time system_instruction, and optional preset voice selection via speech_config; does not support tools, thinking, or text input.gemini-3.5-transcribe-live — Real-time streaming speech-to-text with interim hypotheses, finalized transcripts, smart formatting, and Hybrid VAD.[!WARNING] Legacy Models (
gemini-3.8-live,gemini-3.8-live-extended-thinking,gemini-3.5-live-translate-preview,gemini-3.1-flash-live-preview,gemini-2.5-flash-native-audio-*,gemini-live-2.5-flash-preview,gemini-2.0-flash-live-001): Readreferences/migration.mdfor model replacements and protocol details (thinking_level,behavior: "NON_BLOCKING",server_content.interaction_status,v1betarouting,send_client_content).
google-genai >= 3.2.0 — pip install -U google-genai@google/genai >= 3.2.0 — npm install @google/genai[!IMPORTANT]
v1betais required for the Live API. SDKs>= 3.0.0default tov1, while the Live API (BidiGenerateContent), Ephemeral Tokens (POST /v1beta/auth_tokens), and Voices API (GET /v1beta/voices) requirev1beta. Always initialize clients withhttp_options={"api_version": "v1beta"}(Python) or{ httpOptions: { apiVersion: "v1beta" } }(JS/TS).
[!WARNING] Legacy SDKs
google-generativeai(Python) and@google/generative-ai(JS) are deprecated. Never use them.
To streamline real-time audio/video app development, use a third-party integration supporting the Gemini Live API over WebRTC or WebSockets:
audio/pcm;rate=16000; other rates are resampled). Also supports audio/pcm;rate=8000 with upgraded 8kHz telephony VAD for noisy phone lines, short utterances, and barge-in.[!IMPORTANT] Use
send_realtime_input/sendRealtimeInputfor all real-time streaming user input (audio, video, and text). On Gemini 4 Live (and Gemini 3.8 Live),send_client_content/sendClientContentis supported across the full session lifecycle with explicit roles (userormodel) to inject conversation context (turn_complete=trueunconditionally interrupts active generation).
[!WARNING] Do not use
mediainsendRealtimeInput. Use the specific keys:audiofor audio data,videofor images/video frames, andtextfor text input.
from google import genai
# Reads GEMINI_API_KEY from the environment (or pass api_key="YOUR_API_KEY")
client = genai.Client(http_options={"api_version": "v1beta"})
import { GoogleGenAI } from '@google/genai';
// Reads GEMINI_API_KEY from the environment (or pass apiKey: 'YOUR_API_KEY')
const ai = new GoogleGenAI({ httpOptions: { apiVersion: "v1beta" } });
from google.genai import types
config = types.LiveConnectConfig(
response_modalities=[types.Modality.AUDIO],
system_instruction=types.Content(
parts=[types.Part(text="You are a helpful assistant.")]
)
)
async with client.aio.live.connect(model="gemini-4-live", config=config) as session:
pass # Session is active
const session = await ai.live.connect({
model: 'gemini-4-live',
config: {
responseModalities: ['audio'],
systemInstruction: { parts: [{ text: 'You are a helpful assistant.' }] }
},
callbacks: {
onopen: () => console.log('Connected'),
onmessage: (response) => console.log('Message:', response),
onerror: (error) => console.error('Error:', error),
onclose: () => console.log('Closed')
}
});
await session.send_realtime_input(text="Hello, how are you?")
session.sendRealtimeInput({ text: 'Hello, how are you?' });
await session.send_realtime_input(
audio=types.Blob(data=chunk, mime_type="audio/pcm;rate=16000")
)
session.sendRealtimeInput({
audio: { data: chunk.toString('base64'), mimeType: 'audio/pcm;rate=16000' }
});
# frame: raw JPEG-encoded bytes
await session.send_realtime_input(
video=types.Blob(data=frame, mime_type="image/jpeg")
)
session.sendRealtimeInput({
video: { data: frame.toString('base64'), mimeType: 'image/jpeg' }
});
[!IMPORTANT] A single server event can contain multiple content parts simultaneously (e.g., audio chunks and transcript). Always process all parts in each event to avoid missing content.
async for response in session.receive():
content = response.server_content
if content:
# Audio — process ALL parts in each event
if content.model_turn:
for part in content.model_turn.parts:
if part.inline_data:
audio_data = part.inline_data.data
# Transcription
if content.input_transcription:
print(f"User: {content.input_transcription.text}")
if content.output_transcription:
print(f"Gemini: {content.output_transcription.text}")
# Interruption
if content.interrupted is True:
pass # Stop playback, clear audio queue
// Inside the onmessage callback
const content = response.serverContent;
if (content?.modelTurn?.parts) {
for (const part of content.modelTurn.parts) {
if (part.inlineData) {
const audioData = part.inlineData.data; // Base64 encoded
}
}
}
if (content?.inputTranscription) console.log('User:', content.inputTranscription.text);
if (content?.outputTranscription) console.log('Gemini:', content.outputTranscription.text);
if (content?.interrupted) { /* Stop playback, clear audio queue */ }
gemini-4-live supports two operating modes on a single endpoint controlled by thinking_level:
thinking_level or set thinking_level="minimal" / MINIMAL): Lowest latency (>3x faster Time to First Audio than gemini-3.8-live), standard turn_complete lifecycle, and support for both NON_BLOCKING (default) and explicit BLOCKING function declarations plus function response scheduling (SILENT, WHEN_IDLE, INTERRUPT).thinking_level set to "low", "medium", or "high" / LOW, MEDIUM, HIGH): Use when your voice agent must evaluate complex data, plan multiple steps, or handle long-running tools. The model speaks natural conversational updates (e.g. "Checking flight options now...") while running background reasoning and asynchronous tools.Key requirements for LOW / MEDIUM / HIGH mode:
thinking_config=types.ThinkingConfig(thinking_level="low") ("low" | "medium" | "high"). thinking_budget and XHIGH are not supported on gemini-4-live.behavior="NON_BLOCKING". BLOCKING tools and function response scheduling (SILENT, WHEN_IDLE, INTERRUPT) return errors in this mode.interaction_status): Do not rely on turn_complete=True alone to detect turn completion. Monitor message.server_content.interaction_status (Python) / message.serverContent?.interactionStatus (JS/TS):
"IN_PROGRESS": Server is reasoning, speaking conversational updates, or waiting for async tool responses."IDLE": Server has completed all background reasoning and tool calls; session is ready for user input.See references/migration.md and the Thinking in Live API Guide for complete Python and JavaScript implementation examples.
gemini-4-live)speech_config.voice_config.prebuilt_voice_config.voice_name (or speech_config.voice_config.voice). Always filter when listing preset voices (v1beta client required):
client.voices.list(type_=["prebuilt"])ai.voices.list({ type: ["prebuilt"] })GET /v1beta/voices?type=prebuiltvoice_... IDs or stateless voicekey_... keys created via POST /v1beta/voices) passed in speech_config.voice_config.voice.gemini-4-live fails.speech_config.language_code alongside a voice to choose a language or regional accent.Enable proactive visual responses so the model can speak when relevant visual changes occur:
proactivity=types.ProactivityConfig(proactive_video=True)proactivity: { proactiveVideo: true }realtime_input_config.turn_coverage to be TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO (default) or TURN_INCLUDES_ALL_INPUT (incompatible with TURN_INCLUDES_ONLY_ACTIVITY).proactive_audio: false returns an error).Update system_instruction and/or tools dynamically without reconnecting (wire message: BidiGenerateContentContextUpdate):
await session.send_context_update(system_instruction=..., tools=...) (pass tools=[] to clear tools)session.sendContextUpdate({ systemInstruction: ..., tools: ... })system_instruction or tools invalidates the session prefix cache.Responses report implicit session prefix cache hits via usage_metadata.cached_content_token_count and cache_tokens_details (explicit context caching is not supported).
The Live API supports real-time, low-latency speech-to-speech translation across 70+ languages (4,900+ language pairs), starting in under 2 seconds (~2x faster than gemini-3.5-live-translate-preview), with improved speaker echo handling. Context window: 16K input (16,384) / 32K output (32,768). Does not support tools, thinking, or text input. For full details, see the Live Translate Guide.
gemini-4-live-translate — The recommended translation model for all Live Translate use cases.speech_config to automatically mirror each speaker's tone, pacing, and pitch.speech_config.voice_config.prebuilt_voice_config.voice_name (as a sibling of translation_config inside generationConfig in raw WebSockets—not nested inside translationConfig) for a fixed voice across the session. Always filter preset voices via client.voices.list(type_=["prebuilt"]) / ai.voices.list({ type: ["prebuilt"] }) / GET /v1beta/voices?type=prebuilt.POST /v1beta/voices, voice_... / voicekey_...) are NOT supported and fail at setup with 400 INVALID_ARGUMENT.system_instruction (optional): Provide custom glossaries, domain terminology, and formality/register guidance at setup time (setup-only; no mid-session updates).TranslationConfig)To enable translation, specify a TranslationConfig (target_language_code, optional echo_target_language defaulting to false) inside your live session setup (requires a v1beta client):
translation_config (and optional system_instruction / speech_config) on LiveConnectConfig:
config = types.LiveConnectConfig(
response_modalities=[types.Modality.AUDIO],
translation_config=types.TranslationConfig(
target_language_code="es", # Target language code (e.g. es, fr, pl)
echo_target_language=False,
),
# Optional setup-time glossary / register guidance (setup-only)
system_instruction="Use formal Spanish (usted) and keep product names in English.",
# Optional fixed preset voice; omit speech_config for default instant voice replication
# speech_config=types.SpeechConfig(
# voice_config=types.VoiceConfig(
# prebuilt_voice_config=types.PrebuiltVoiceConfig(voice_name="Kore")
# )
# ),
input_audio_transcription=types.AudioTranscriptionConfig(),
output_audio_transcription=types.AudioTranscriptionConfig(),
)
async with client.aio.live.connect(model="gemini-4-live-translate", config=config) as session:
pass
translationConfig (and optional speechConfig as a sibling—not nested inside translationConfig) inside generationConfig:
{
"setup": {
"model": "models/gemini-4-live-translate",
"generationConfig": {
"responseModalities": ["AUDIO"],
"translationConfig": {
"targetLanguageCode": "es",
"echoTargetLanguage": false
},
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
}
}
}
The Live API supports real-time streaming speech-to-text over WebSockets with low-latency interim hypotheses, finalized transcripts, and Hybrid VAD. For full details, see the Live Transcription Guide and Colab Cookbook.
gemini-3.5-transcribe-livesmart: cleans up filler words, resolves inline self-corrections, and structures formatting.verbatim (default): exact word-for-word transcript.config = types.LiveConnectConfig(
response_modalities=["TEXT"],
input_audio_transcription=types.AudioTranscriptionConfig(),
)
async with client.aio.live.connect(model="gemini-3.5-transcribe-live", config=config) as session:
# Stream audio
await session.send_realtime_input(audio=types.Blob(data=chunk, mime_type="audio/pcm;rate=16000"))
# Hybrid VAD: notify turn end on client-detected silence for zero latency
await session.send_realtime_input(audio_stream_end=True)
const session = await ai.live.connect({
model: 'gemini-3.5-transcribe-live',
config: {
responseModalities: ['text'],
inputAudioTranscription: { mode: 'smart' }
},
callbacks: {
onmessage: (msg) => {
if (msg.serverContent?.interimInputTranscription) {
console.log('Interim:', msg.serverContent.interimInputTranscription.text);
}
if (msg.serverContent?.inputTranscription) {
console.log('Final:', msg.serverContent.inputTranscription.text);
}
}
}
});
session.sendRealtimeInput({ audio: { data: chunkBase64, mimeType: 'audio/pcm;rate=16000' } });
session.sendRealtimeInput({ audioStreamEnd: true }); // Hybrid VAD
{
"setup": {
"model": "models/gemini-3.5-transcribe-live",
"generationConfig": {
"responseModalities": ["TEXT"],
"speechConfig": {
"voiceConfig": {}
}
},
"inputAudioTranscription": {
"mode": "smart"
}
}
}
TEXT or AUDIO per session, not both. Native audio models output audio (response_modalities=["AUDIO"]); enable output_audio_transcription if you need text transcripts.gemini-4-live: 128K input (131,072) / 64K output (65,536) tokens; gemini-4-live-translate: 16K input (16,384) / 32K output (32,768) tokensgemini-4-live does not support Google Maps, Code Execution, URL Context, thinking_budget, XHIGH, designed voices, or explicit context caching (google_search and custom function_declarations are supported). gemini-4-live-translate does not support tools, thinking, text input, or Voices API custom voices.For step-by-step migration checklists and protocol deltas when upgrading from gemini-3.8-live, gemini-3.8-live-extended-thinking, gemini-3.5-live-translate-preview, gemini-3.1-flash-live-preview, gemini-2.5-flash-native-audio-*, or gemini-2.0-flash-live-001 to Gemini 4 Live (gemini-4-live) and Gemini 4 Live Translate (gemini-4-live-translate), read references/migration.md.
v1beta (http_options={"api_version": "v1beta"} in Python; { httpOptions: { apiVersion: "v1beta" } } in JS/TS) because SDKs >= 3.0.0 default to v1send_realtime_input for real-time user input (audio, video, text). Use send_client_content with explicit user/model roles to inject context turns mid-streamaudioStreamEnd / audio_stream_end (Hybrid VAD) when the mic is paused or user finishes speakinginterrupted: true)server_content.interaction_status (serverContent?.interactionStatus in JS/TS; IN_PROGRESS vs IDLE) when using gemini-4-live with thinking_level set to LOW/MEDIUM/HIGH rather than relying on turn_complete aloneIf the search_docs tool (from the Google MCP server) is available, use it as your only documentation source:
search_docs with your query[!IMPORTANT] When MCP tools are present, never fetch URLs manually. MCP provides up-to-date, indexed documentation that is more accurate and token-efficient than URL fetching.
If no MCP documentation tools are available, fetch from the official docs index:
llms.txt URL: https://aistudio.google.com/llms.txt
This index contains links to all documentation pages in .md format. Use web fetch tools to:
llms.txt to discover available documentation pageshttps://aistudio.google.com/docs/live-api/session-management.md)[!IMPORTANT] Those are not all the documentation pages. Use the
llms.txtindex to discover available documentation pages
server_content.interaction_status, non-blocking toolsThe Live API supports 70 languages including: English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, Korean, Hindi, Arabic, Russian, and many more. Native audio models automatically detect and switch languages.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/gemini-api-cliCall the Gemini API from the shell with gemini-api. Use for media generation (images, TTS, music, video), file and YouTube analysis, audio/video transcription, Deep Research, and sandboxed agents./gemini-api-devUse this skill when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice design, voice replication, streaming responses, background research tasks, function calling, structured output, calibrated decisions (yes/no, choice, rubric scoring), or migrating from the old generateContent API. Covers SDK usage and best practices for Gemini models and agents in Python and TypeScript./gemini-omni-flash-apiUse this skill for generative video editing, text-to-video, image- and video-referenced video generation, first-frame-to-video, first-and-last-frame transitions, and video extensions using Gemini Omni 1.2 Flash (gemini-omni-1.2-flash) via the official google-genai SDK. Includes workflows for pre-processing/optimizing high-resolution or long source videos with ffmpeg, stripping audio for full sound regeneration, and handling turn-by-turn video editing and parallel execution.npx claudepluginhub google-gemini/gemini-skills --plugin gemini-skillsOther plugins' skills for the same job