google-gemini/gemini-live-api-examples
关于
Gemini Live 提供多模态实时智能体能力。构建能够实时处理视觉和文本的语音智能体。
人工智能与机器学习可以做什么
- Multilingual support: Converse in 70 supported languages.
- Unified thinking: Route gemini-4-live between fast default dialogue (MINIMAL or omitted) and background reasoning (LOW, MEDIUM, HIGH) on a single endpoint.
- Barge-in: Users can interrupt the model at any time for responsive interactions.
- Tool use: Integrates asynchronous (NON_BLOCKING, default) and BLOCKING (default/MINIMAL mode only) function calling, plus Google Search grounding.
实测星标增长
- 24小时
- +2
- 7天
- +9
- 15天
- +14
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Gemini Live API Examples
The Live API enables low-latency, real-time voice and video interactions with Gemini. It processes continuous streams of audio, video, or text to deliver immediate, human-like spoken responses, creating a natural conversational experience for your users.

Try the Live API in Google AI Studio
Example use cases
Live API can be used to build real-time voice and video agents for a variety of industries, including:
- E-commerce and retail: Shopping assistants that offer personalized recommendations and support agents that resolve customer issues.
- Gaming: Interactive non-player characters (NPCs), in-game help assistants, and real-time translation of in-game content.
- Next-gen interfaces: Voice- and video-enabled experiences in robotics, smart glasses, and vehicles.
- Healthcare: Health companions for patient support and education.
- Financial services: AI advisors for wealth management and investment guidance.
- Education: AI mentors and learner companions that provide personalized instruction and feedback.
Models
gemini-4-live(Gemini 4 Live): Unified real-time voice and video model supporting both fast low-latency dialogue (default /MINIMALthinking_level) and deeper background reasoning (LOW,MEDIUM, orHIGHthinking_levelwithserver_content.interaction_statusIN_PROGRESS/IDLE). Supports the extended voice library (2,000+ preset voices, filtered viatype=["prebuilt"]) plus custom Voice replication (voice_.../voicekey_...) for Paid Tier 3 projects. Designed voices are not supported ongemini-4-live.gemini-4-live-translate(Gemini 4 Live Translate): Real-time speech-to-speech streaming translation. Uses instant voice replication by default (omittingspeech_config), with optional selection from the 2,000+ preset voice library (type=["prebuilt"]). Custom voices created via the Voices API are not supported ongemini-4-live-translate.
[!IMPORTANT] Requires
google-genai >= 3.2.0(Python) or@google/genai >= 3.2.0(JS/TS) configured withv1beta(http_options={"api_version": "v1beta"}/httpOptions: { apiVersion: "v1beta" }), since SDK3.0.0+defaults tov1.
Key features
Live API offers a comprehensive set of features for building robust voice and video agents:
- Multilingual support: Converse in 70 supported languages.
- Unified thinking:
Route
gemini-4-livebetween fast default dialogue (MINIMALor omitted) and background reasoning (LOW,MEDIUM,HIGH) on a single endpoint. - Barge-in: Users can interrupt the model at any time for responsive interactions.
- Tool use:
Integrates asynchronous (
NON_BLOCKING, default) andBLOCKING(default/MINIMALmode only) function calling, plus Google Search grounding. - Audio transcriptions: Provides text transcripts of both user input and model output.
- Proactive audio & video:
Proactive audio is always enabled on
gemini-4-live, and optional Proactive Video (proactiveVideo: true) lets the model respond proactively to camera or screen frames. - Mid-session context updates:
Update
system_instructionortoolsmid-session without reconnecting viasend_context_update/sendContextUpdate/BidiGenerateContentContextUpdate(note: invalidates the session prefix cache).
Technical specifications
The following table outlines the technical specifications for the Live API:
| Category | Details |
|---|---|
| Input modalities | Audio (raw 16-bit PCM audio, 16kHz, little-endian), images/video (JPEG <= 1FPS), text |
| Output modalities | Audio (raw 16-bit PCM audio, 24kHz, little-endian), text |
| Protocol | Stateful WebSocket connection (WSS) |
Examples
- Gen AI SDK Python example: Recommended for ease of use. Connect to the Gemini Live API using the Gen AI SDK to build a real-time multimodal application with a Python backend.
- Ephemeral tokens and raw WebSocket example: RAW protocol control. Connect to the Gemini Live API using WebSockets to build a real-time multimodal application with a JavaScript frontend and a Python backend.
- Command-line Python example: A minimal command-line app that streams microphone audio to the Gemini Live API and plays back the response in real time using Python.
- Command-line Node.js example: A minimal command-line app that streams microphone audio to the Gemini Live API and plays back the response in real time using Node.js.
- Command-line Translation Python example: A command-line tool that streams a remote audio URL into Gemini 4 Live Translate (
gemini-4-live-translate), plays back the translated audio, and prints transcripts with language codes in real time. - Broadcast Translation Web App (LiveKit): A production-ready multilingual broadcast app built with Next.js, LiveKit, and the Gemini Live API that translates speaker audio to multiple target languages concurrently with low latency. (Note: This project has moved to a standalone repository)
[!TIP] Install the Gemini Live API Dev skill for AI-assisted development with the Live API in your coding agents.
Partner integrations
To streamline the development of real-time audio and video apps, you can use a third-party integration that supports the Gemini Live API over WebRTC or WebSockets.
- LiveKit: Use the Gemini Live API with LiveKit Agents.
- Pipecat by Daily: Create a real-time AI chatbot using Gemini Live and Pipecat.
- Fishjam by Software Mansion: Create live video and audio streaming applications with Fishjam.
- Vision Agents by Stream: Build real-time voice and video AI applications with Vision Agents.
- Voximplant: Connect inbound and outbound calls to Live API with Voximplant.
- Agent Development Kit (ADK): Create an agent and use the Agent Development Kit (ADK) Streaming to enable voice and video communication.
- Firebase AI SDK: Get started with the Gemini Live API using Firebase AI Logic.
探索相关项目
加载中…