gemini-live-api-dev
Development guide for real-time multimodal live interactions with Gemini.
Install
mkdir -p .claude/skills/gemini-live-api-dev && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9697" && unzip -o skill.zip -d .claude/skills/gemini-live-api-dev && rm skill.zipInstalls to .claude/skills/gemini-live-api-dev
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Guides the usage of the Gemini Live (Multimodal Live) API using the Gen AI SDK. Use when the user asks about real-time, bidirectional streaming of voice and video with Gemini. Covers configuration, session management, sending/receiving audio/video media, and tool integration.Key capabilities
- →Bidirectional WebSocket streaming
- →Real-time audio and video processing
- →Function calling for tool integration
- →Session configuration management
How it works
The API establishes a WebSocket connection to stream bidirectional media, allowing the model to process input and generate responses in real-time.
Inputs & outputs
When to use gemini-live-api-dev
- →Build real-time voice assistant
- →Integrate live video with Gemini
- →Manage Live API sessions
About this skill
Gemini Live (Multimodal Live) API
The Multimodal Live API allows you to have low-latency, bidirectional, voice and video interactions with Gemini. Use this for building real-time voice assistants, interactive video applications, and other low-latency AI experiences.
Key Features
- Bidirectional Streaming: Low-latency communication over WebSockets.
- Audio & Video Support: Send and receive real-time audio and video streams.
- Multimodal Understanding: The model "sees" and "hears" the stream directly.
- Tool Integration: Use function calling within live sessions.
Core Directives
- SDK Requirement: Use the latest version of the Gen AI SDK (
google-genaifor Python,@google/genaifor JS/TS). - WebSocket Protocol: The API operates over WebSockets (WSS). The SDK abstracts this for you.
- Model Selection: Use models specifically optimized for live interactions, such as
gemini-2.0-flash-exp(or later versions likegemini-live-2.5-flash-native-audio).
Getting Started (Python)
Installation
pip install google-genai
Basic Session Management
from google import genai
client = genai.Client(api_key='YOUR_API_KEY', http_options={'api_version': 'v1alpha'})
# Configures the live session
with client.live.connect(model='gemini-2.0-flash-exp', config={'generation_config': {'response_modalities': ['audio']}}) as session:
# Send a message (text or audio bytes)
session.send(input='Hello! How can you help me today?', end_of_turn=True)
# Receive and process responses (text, audio, or tool calls)
for message in session.receive():
if message.text:
print(f'Gemini: {message.text}')
if message.server_content:
# handle audio bytes from message.server_content.model_turn.parts
pass
Handling Media
Sending Audio
Audio should be sent as raw bytes (16-bit PCM, 16kHz or 24kHz recommended).
import sounddevice as sd
def audio_callback(indata, frames, time, status):
# indata contains raw audio bytes
session.send(input=indata.tobytes())
# In a separate thread or async loop:
with sd.InputStream(callback=audio_callback, channels=1, samplerate=16000):
# keep session alive
pass
Receiving Audio
The model response includes audio bytes that can be played in real-time.
for response in session.receive():
if response.server_content and response.server_content.model_turn:
for part in response.server_content.model_turn.parts:
if part.inline_data:
audio_bytes = part.inline_data.data
# Play audio_bytes using your preferred library
Tool Integration (Function Calling)
You can provide tools to the Live API just like the standard Gemini API.
def turn_light_on():
return {'status': 'light is on'}
config = {
'tools': [turn_light_on],
'generation_config': {'response_modalities': ['audio']}
}
with client.live.connect(model='gemini-2.0-flash-exp', config=config) as session:
# Gemini will call the tool if the user asks
for message in session.receive():
if message.tool_call:
# Handle the tool call manually or using SDK helpers
pass
Documentation & Best Practices
- Official Web Docs: https://ai.google.dev/gemini-api/docs/multimodal-live
- Latency: Keep buffers small and use high-performance audio/video libraries.
- Safety: Standard Gemini safety settings apply to the Live API.
- Interruption: Handle scenarios where the user interrupts the AI (the SDK provides
session.interrupt()).
When not to use it
- →Non-real-time data processing
- →Applications requiring high-latency processing
Prerequisites
Limitations
- →Requires specific models optimized for live interactions
- →Performance depends on network latency and buffer management
How it compares
Unlike standard REST APIs, this uses persistent WebSocket connections for low-latency, bidirectional streaming of multimodal data.
Compared to similar skills
gemini-live-api-dev side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| gemini-live-api-dev (this skill) | 0 | 3mo | Review | Intermediate |
| openrouter-hello-world | 7 | 27d | Caution | Beginner |
| telegram-dev | 2 | 8mo | Review | Intermediate |
| chroma | 2 | 7mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by LowyShin
View all by LowyShin →You might also like
openrouter-hello-world
jeremylongshore
Create your first OpenRouter API request with a simple example. Use when learning OpenRouter or testing your setup. Trigger with phrases like 'openrouter hello world', 'openrouter first request', 'openrouter quickstart', 'test openrouter'.
telegram-dev
2025Emma
Telegram 生态开发全栈指南 - 涵盖 Bot API、Mini Apps (Web Apps)、MTProto 客户端开发。包括消息处理、支付、内联模式、Webhook、认证、存储、传感器 API 等完整开发资源。
chroma
davila7
Open-source embedding database for AI applications. Store embeddings and metadata, perform vector and full-text search, filter by metadata. Simple 4-function API. Scales from notebooks to production clusters. Use for semantic search, RAG applications, or document retrieval. Best for local development and open-source projects.
ccxt
2025Emma
CCXT cryptocurrency trading library. Use for cryptocurrency exchange APIs, trading, market data, order management, and crypto trading automation across 150+ exchanges. Supports JavaScript/Python/PHP.
langfuse-install-auth
jeremylongshore
Install and configure Langfuse SDK authentication for LLM observability. Use when setting up a new Langfuse integration, configuring API keys, or initializing Langfuse tracing in your project. Trigger with phrases like "install langfuse", "setup langfuse", "langfuse auth", "configure langfuse API key", "langfuse tracing setup".
perplexity-known-pitfalls
jeremylongshore
Identify and avoid Perplexity anti-patterns and common integration mistakes. Use when reviewing Perplexity code for issues, onboarding new developers, or auditing existing Perplexity integrations for best practices violations. Trigger with phrases like "perplexity mistakes", "perplexity anti-patterns", "perplexity pitfalls", "perplexity what not to do", "perplexity code review".