This is a comprehensive guide that covers capabilities and configurations available with the Live API. See Get started with Live API page for an overview and sample code for common use cases.
Before you begin
- Familiarize yourself with core concepts: If you haven't already done so, read the Get started with Live API page first. This will introduce you to the fundamental principles of the Live API, how it works, and the different implementation approaches.
- Try the Live API in AI Studio: You may find it useful to try the Live API in Google AI Studio before you start building. To use the Live API in Google AI Studio, select Stream.
Model comparison
The following table summarizes the key differences between the Gemini 3.8 Live, Gemini 3.8 Live Extended Thinking, and Gemini 3.1 Flash Live Preview models:
| Feature | Gemini 3.8 Live | Gemini 3.8 Live Extended Thinking | Gemini 3.1 Flash Live Preview |
|---|---|---|---|
| Recommended for | Default option for most low-latency voice agent experiences. | Recommended when higher background reasoning is required. | Legacy preview model. We recommend updating to Gemini 3.8 Live. |
| Thinking | Supported (interleaved reasoning). thinkingLevel is not supported (omit from setup). |
Supported. Configurable background reasoning (thinkingLevel: low, medium, high; minimal is not supported). |
Uses thinkingLevel to control thinking depth with settings like minimal, low, medium, and high. Defaults to minimal to optimize for lowest latency. See Thinking in the Live API. |
| Receiving response | A single server event can contain multiple content parts simultaneously. | A single server event can contain multiple content parts simultaneously. When asynchronous reasoning is active, turnComplete: true does not indicate an idle session; use interaction_status (IN_PROGRESS versus IDLE). |
A single server event can contain multiple content parts simultaneously (for example, inlineData and transcript). Ensure your code processes all parts in each event to avoid missing content. |
| Client content | send_client_content is supported throughout the entire session lifecycle with explicit roles (user or model). turn_complete=true unconditionally interrupts generation. |
send_client_content is supported throughout the entire session lifecycle with explicit roles (user or model). turn_complete=true unconditionally interrupts generation. |
send_client_content is supported throughout the entire session lifecycle with explicit roles (user or model). turn_complete=true unconditionally interrupts generation. |
Asynchronous function calling (behavior: NON_BLOCKING) |
Supported (default). Set behavior: NON_BLOCKING or use backwards-compatible blocking mode with behavior: BLOCKING. Function scheduling (SILENT, WHEN_IDLE, INTERRUPTED) is supported. |
Supported (Async only). Only NON_BLOCKING execution is supported. Blocking mode and function scheduling are not supported. |
Not supported. Function calling is sequential only. The model will not start responding until you've sent the tool response. |
To migrate to Gemini 3.8 Live, see the migration guide. To learn more about Thinking, see the Thinking guide and the upgrade guide.
Establishing a connection
The following example shows how to create a connection with an API key:
Python
import