Google launched Gemini 3.1 Flash Live via the Live API for building real-time voice and vision agents. The model processes continuous audio, video, and text streams to deliver immediate spoken responses with acoustic nuance detection and 90+ language support.
Key improvements over Gemini 2.5 Flash Native Audio:
- Better noise filtering in real-world environments
- Stronger adherence to complex system instructions
- More natural dialogue with improved latency
- Thinking capability via
thinkingLevel(minimal/low/medium/high) instead ofthinkingBudget
The model outputs native audio (no STT+TTS pipeline) with a 128k context window. It supports synchronous function calling, Google Search grounding, and video input alongside audio.
import asyncio
from google import genai
client = genai.Client(api_key="YOUR_API_KEY")
model = "gemini-3.1-flash-live-preview"
config = {"response_modalities": ["AUDIO"]}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
print("Session started")
# Send content...
if __name__ == "__main__":
asyncio.run(main())
A single server event can now contain multiple content parts simultaneously (audio chunks + transcript), so process all parts in each event.