Multimodal Live API
Multimodal Live API on Google Cloud is a Gemini realtime, bidirectional streaming interface for text, audio, video frames, tools, and native audio over WebSocket or the Google Gen AI SDK. It is commonly used through Vertex AI and can be deployed into Agent Engine or Agent Runtime for serverless conversational agents.
Synthesized across 10 notebooks. See the source pages under Notebooks below for line-level grounding.
Engineers use the Live API when they need low-latency, turn-aware interaction rather than batch request/response generation. The notebooks show two main access paths: the Google Gen AI SDK for simpler session management, and raw WebSockets when direct control over setup messages, payloads, audio buffers, and interruption handling is required.
A typical session starts with Google Cloud authentication, a project, a region, and a setup/config message that declares modalities, tools, transcription, speech settings, and realtime input behavior. After setup, the client streams client_content for discrete turns or realtime_input for high-frequency audio and video chunks while concurrently receiving model turns, inline audio, transcriptions, tool calls, and turn-completion signals.
Production-oriented examples extend the Live API with Agent Engine, ADK, RAG, Vertex AI Search, Vertex AI Vector Search, and structured function responses. The recurring engineering concerns are authentication freshness, region-specific endpoints, raw PCM audio formats, tool declaration timing, quota-aware retry behavior, session lifecycle, and cleanup of deployed resources.
Canonical workflow
- Enable the Vertex AI API, authenticate with Google Cloud credentials, and set PROJECT_ID plus LOCATION or the equivalent environment variables.
- Choose the client path: Google Gen AI SDK for simpler Live API sessions, raw WebSocket for direct protocol control, or Agent Engine/Agent Runtime for deployed bidirectional agents.
- Create the Live API configuration or setup message with model, response modalities, speech settings, transcription, realtime input settings, system instructions, and any tools required for the session.
- Open the Live API session or WebSocket connection, send setup once immediately, and wait for the setup response before streaming user input.
- Run send and receive loops concurrently, using client_content for discrete text turns and realtime_input for streaming audio or video frames.
- Encode input audio as raw 16-bit PCM at 16 kHz and decode output audio as raw 16-bit PCM at 24 kHz; buffer streamed inline audio until turn completion or interruption handling requires clearing it.
- For tools or RAG, retrieve or execute external data in application code, return function results in the expected response format, and ground answers with document chunks and citations where applicable.
- Close or clean up sessions, deployed agents, staging resources, and endpoints when finished to avoid stale state or ongoing charges.
Best practices
See Multimodal Live API - Best Practices for the full distilled guide.
- Use the Google Gen AI SDK when you want simplified Live API session handling; use raw WebSockets when you need full control over handshake, JSON payloads, and low-level streaming behavior.
- Set PROJECT_ID and LOCATION before constructing model paths, clients, staging buckets, or WebSocket hosts, and use regional aiplatform.googleapis.com endpoints for non-global locations.
- Refresh google.auth credentials before HTTP or WebSocket calls, especially because application-default access tokens have a limited lifetime.
- Send the setup message once immediately after opening a WebSocket, wait for the setup response, and declare all tools at session start.
- Use concurrent send and receive loops, commonly with asyncio.gather or queues, for continuous bidirectional sessions.
- Use realtime_input for high-frequency audio and video chunks, and client_content for discrete text turns.
Key models & APIs
- gemini-live-2.5-flash-native-audio, gemini-2.0-flash-live-preview-04-09, Gemini 3.1 Pro, gemini-3.5-flash, gemini-3.1-flash-image, text-embedding-005, Gemini Live API, Multimodal Live API, Google Gen AI SDK, Vertex AI API, Vertex AI Agent Engine, Agent Runtime, ADK, AdkApp, LiveConnectConfig, ProactivityConfig, ToolContext, Vertex AI Search, Vertex AI Vector Search
Notebooks (10)
Agents & ADK (2)
- Getting Started with Bidirectional Streaming v2 on Agent Runtime — Builds and deploys Agent Runtime bidirectional streaming agents, including a Live API audio agent.
- Getting Started with Live API on Agent Engine — Deploys bidirectional streaming agents on Vertex AI Agent Engine using Gemini Live API audio and ADK tools.
Gemini (8)
- Introduction to Gemini Deep Research Agent — Shows how to run Gemini Deep Research Agent with streaming, multimodal input/output, and grounding tools.
- Getting Started with the Live API Native Audio — Connects to Gemini Live API native audio with proactive chime-in and affective dialog examples.
- Getting Started with Gemini Live API using WebSocket — Uses Gemini Live API over WebSocket for text, audio, video, tools, and native audio features.
- Getting Started with Gemini Live API using Gen AI SDK — Introduces Gemini Live API audio sessions, tools, transcription, and VAD with the Google Gen AI SDK.
- Gemini Live API Quickstart — Connects to Gemini Live API for bidirectional audio streaming with Gen AI SDK and raw WebSockets.
- Interactive Loan Application Assistant (Financial Services) — Builds a Gemini 2.0 loan document assistant with RAG, large context, audio, Vertex AI Search, and Vector Search.
- Real-time Retrieval Augmented Generation (RAG) using the Multimodal Live API with Gemini 2.0 — Builds a retail RAG pipeline with Gemini Multimodal Live API for grounded text and audio answers.
- Get hands-on with a customer support use case using Gemini and Gen AI SDK — Builds a Gemini customer-support flow for retail product matching, room-fit reasoning, tools, search, and Live API audio.
Related concepts
- Agents & ADK · RAG & Grounding · Getting Started · Audio & Speech · Function Calling & Tools · Agent Engine · Embeddings & Vector Search · Applied Use Cases
Part of the Generative AI Google Brain · Multimodal Live API - Best Practices