Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use this skill when building real-time, bidirectional streaming applications with the Gemini Live API. Covers WebSocket-based audio/video/text streaming, voice activity detection (VAD), native audio features, function calling, session management, ephemeral tokens for client-side auth,...
.claude/skills/sickn33-gemini-live-api-dev/SKILL.md| Model | Eval pass | Runs |
|---|---|---|
| gemini-3.6-flash | 100% | 8 |
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 239% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 150% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 97% | 0% |
Use this skill when building real-time, bidirectional streaming applications with the Gemini Live API. Covers WebSocket-based audio/video/text streaming, voice activity detection (VAD), native audio features, function calling, session management, ephemeral tokens for client-side auth,...
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.
Key capabilities:
thinkingLevel)> !NOTE] > The Live API currently only supports WebSockets. For WebRTC support or simplified integration, use a partner integration.
gemini-3.1-flash-live-preview — Optimized for low-latency, real-time dialogue. Native audio output, thinking (via thinkingLevel). 128k context window. This is the recommended model for all Live API use cases.gemini-3.5-live-translate-preview — Real-time streaming translation model.> !WARNING] > The following Live API models are deprecated and will be shut down. Migrate to gemini-3.1-flash-live-preview. > - gemini-2.5-flash-native-audio-preview-12-2025 — Migrate to gemini-3.1-flash-live-preview. > - gemini-live-2.5-flash-preview — Released June 17, 2025. Shutdown: December 9, 2025. > - gemini-2.0-flash-live-001 — Released April 9, 2025. Shutdown: December 9, 2025.
google-genai — pip install google-genai@google/genai — npm install @google/genai> !WARNING] > Legacy SDKs google-generativeai (Python) and @google/generative-ai (JS) are deprecated. Use the new SDKs above.
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> !IMPORTANT] > Use send_realtime_input / sendRealtimeInput for all real-time user input (audio, video, and text). send_client_content / sendClientContent is only supported for seeding initial context history (requires setting initial_history_in_client_content in history_config). Do not use it to send new user messages during the conversation.
> !WARNING] > Do not use media in sendRealtimeInput. Use the specific keys: audio for audio data, video for images/video frames, and text for text input.
pythonimport os from google import genai client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
jsimport { GoogleGenAI } from '@google/genai'; const ai = new GoogleGenAI({ apiKey: 'YOUR_API_KEY' });
pythonfrom 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-3.1-flash-live-preview", config=config) as session: pass # Session is active
jsconst session = await ai.live.connect({ model: 'gemini-3.1-flash-live-preview', 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') } });
pythonawait session.send_realtime_input(text="Hello, how are you?")
jssession.sendRealtimeInput({ text: 'Hello, how are you?' });
pythonawait session.send_realtime_input( audio=types.Blob(data=chunk, mime_type="audio/pcm;rate=16000") )
jssession.sendRealtimeInput({ audio: { data: chunk.toString('base64'), mimeType: 'audio/pcm;rate=16000' } });
python# frame: raw JPEG-encoded bytes await session.send_realtime_input( video=types.Blob(data=frame, mime_type="image/jpeg") )
jssession.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.
pythonasync 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
js// 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 */ }
The Live API supports real-time, low-latency streaming translation of speech (audio) across 70+ languages. For full details on options and capabilities, see the Live Translate Guide.
gemini-3.5-live-translate-preview — The recommended translation model for all Live Translate use cases.TranslationConfig)To enable translation, specify a TranslationConfig object inside your live session setup:
translation_config on LiveConnectConfig:python 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=True, ), input_audio_transcription=types.AudioTranscriptionConfig(), output_audio_transcription=types.AudioTranscriptionConfig(), )
translationConfig inside generationConfig:json { "setup": { "model": "models/gemini-3.5-live-translate-preview", "generationConfig": { "responseModalities": ["AUDIO"], "translationConfig": { "targetLanguageCode": "es", "echoTargetLanguage": true } } } }
TEXT or AUDIO per session, not both. Native audio models only support audio.When migrating from gemini-2.5-flash-native-audio-preview-12-2025 to gemini-3.1-flash-live-preview:
gemini-2.5-flash-native-audio-preview-12-2025 to gemini-3.1-flash-live-preview.thinkingLevel (minimal, low, medium, high) instead of thinkingBudget. Default is minimal for lowest latency.send_client_content is only for seeding initial context history (set initial_history_in_client_content in history_config). Use send_realtime_input for text during conversation.TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO instead of TURN_INCLUDES_ONLY_ACTIVITY. If sending constant video frames, consider sending only during audio activity to reduce costs.send_realtime_input for all real-time user input (audio, video, text). Reserve send_client_content only for seeding initial context historyaudioStreamEnd when the mic is paused to flush cached audioIf 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://ai.google.dev/gemini-api/docs/llms.txt
This index contains links to all documentation pages in .md.txt format. Use web fetch tools to:
llms.txt to discover available documentation pageshttps://ai.google.dev/gemini-api/docs/live-session.md.txt)> !IMPORTANT] > Those are not all the documentation pages. Use the llms.txt index to discover available documentation pages
The 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.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 19,451 | 10,732 | -45% | 1 | 1 | 0% | 3,456 | 5,966 | +73% | 0 | 0 | — |
case-02 | fail→pass | 17,805 | 12,684 | -29% | 1 | 1 | 0% | 3,169 | 6,234 | +97% | 0 | 0 | — |
case-03 | fail→pass | 11,917 | 11,990 | +1% | 1 | 1 | 0% | 1,832 | 6,216 | +239% | 0 | 0 | — |
case-04 | pass→pass | 9,392 | 6,433 | -32% | 1 | 1 | 0% | 1,821 | 5,098 | +180% | 0 | 0 | — |
case-05 | pass→pass | 7,228 | 8,149 | +13% | 1 | 1 | 0% | 1,358 | 5,221 | +284% | 0 | 0 | — |
case-06 | pass→pass | 13,694 | 11,930 | -13% | 1 | 1 | 0% | 2,513 | 6,186 | +146% | 0 | 0 | — |
case-07 | pass→pass | 9,156 | 1,772 | -81% | 1 | 1 | 0% | 1,293 | 4,084 | +216% | 0 | 0 | — |
case-08 | pass→pass | 14,184 | 2,557 | -82% | 1 | 1 | 0% | 2,273 | 4,186 | +84% | 0 | 0 | — |
case-09 | pass→pass | 5,901 | 1,837 | -69% | 1 | 1 | 0% | 886 | 4,037 | +356% | 0 | 0 | — |
case-10 | fail→pass | 14,099 | 10,279 | -27% | 1 | 1 | 0% | 2,313 | 5,788 | +150% | 0 | 0 | — |
case-11 | pass→pass | 8,361 | 3,162 | -62% | 1 | 1 | 0% | 1,347 | 4,297 | +219% | 0 | 0 | — |
case-12 | fail→pass | 13,192 | 6,022 | -54% | 1 | 1 | 0% | 2,462 | 4,838 | +97% | 0 | 0 | — |
case-13 | fail→pass | 9,953 | 3,280 | -67% | 1 | 1 | 0% | 1,671 | 4,354 | +161% | 0 | 0 | — |
case-14 | pass→pass | 7,978 | 3,638 | -54% | 1 | 1 | 0% | 1,057 | 4,359 | +312% | 0 | 0 | — |
case-15 | fail→pass | 8,213 | 1,754 | -79% | 1 | 1 | 0% | 1,356 | 4,037 | +198% | 0 | 0 | — |
case-16 | pass→pass | 5,818 | 2,827 | -51% | 1 | 1 | 0% | 797 | 4,221 | +430% | 0 | 0 | — |
case-17 | fail→pass | 8,063 | 6,380 | -21% | 1 | 1 | 0% | 1,577 | 5,068 | +221% | 0 | 0 | — |
case-18 | pass→pass | 16,255 | 9,964 | -39% | 1 | 1 | 0% | 2,475 | 5,442 | +120% | 0 | 0 | — |
case-19 | pass→pass | 12,793 | 2,028 | -84% | 1 | 1 | 0% | 1,944 | 4,030 | +107% | 0 | 0 | — |
case-20 | fail→pass | 12,963 | 2,040 | -84% | 1 | 1 | 0% | 2,062 | 4,136 | +101% | 0 | 0 | — |
case-21 | pass→pass | 15,451 | 13,631 | -12% | 1 | 1 | 0% | 2,588 | 6,205 | +140% | 0 | 0 | — |
case-22 | fail→pass | 9,888 | 3,355 | -66% | 1 | 1 | 0% | 1,486 | 4,334 | +192% | 0 | 0 | — |
case-23 | fail→pass | 11,229 | 2,722 | -76% | 1 | 1 | 0% | 1,783 | 4,287 | +140% | 0 | 0 | — |
case-24 | fail→pass | 11,821 | 3,363 | -72% | 1 | 1 | 0% | 1,827 | 4,369 | +139% | 0 | 0 | — |
case-25 | pass→pass | 12,744 | 4,047 | -68% | 1 | 1 | 0% | 2,005 | 4,498 | +124% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +48 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.