Gemini 3.8 Live API: Tools, Reasoning, and Session Handling
Build one Gemini 3.8 Live API tool workflow with correct reasoning signals, session state, interruption handling, and failure recovery.

I’m Dora. I started with one rule: the microphone button must not depend on whether a tool has finished. My first state diagram failed. It treated turnComplete as “the job is done,” returning the interface to listening while the tool still ran.
That is the important change in the Gemini 3.8 Live API. I mapped one voice request to one asynchronous availability lookup and traced every documented event. This is not a latency test. It is the record I would hand to the developer running it in Google AI Studio.
What Changes in a Gemini 3.8 Live API Session

Standard Live Turns and Extended-Thinking Turns
Gemini-3.8-live suits immediate dialogue and quick tools. Its turnComplete: true means the response turn ended and the session is idle.
Gemini-3.8-live-extended-thinking can speak, call a tool, and speak again. Each utterance may carry turnComplete while interaction_status remains IN_PROGRESS. Only IDLE closes the interaction. Google’s Live thinking guide documents this split and three thinking levels. It does not expose chain-of-thought.
The Events Your Client Must Track
I track setupComplete, audio chunks, turnComplete, interaction_status, tool-call ID, serverContent.interrupted, and the latest resumption handle.
turnComplete stops one playback segment; interaction_status == IDLE unlocks the next task. I paused here. Two completion signals are easy to merge and unpleasant to debug.
Connect and Configure One Tool-Using Voice Agent
Open the Live Session and Set Audio Output
The official Python package is google-genai; the model ID is Gemini-3.8-live-extended-thinking. I keep the key in the environment:
from google import genai
from google.genai import types
client = genai.Client()
model = "Gemini-3.8-live-extended-thinking"
config = types.LiveConnectConfig(
response_modalities=["AUDIO"],
thinking_config=types.ThinkingConfig(thinking_level="low"),
)
Input is raw 16-bit PCM, natively 16 kHz; output is 24 kHz. The Live capabilities reference defines formats, transcription fields, and interruptions.

Declare a Non-Blocking Function
Extended Thinking requires asynchronous declarations. Blocking is unsupported.
lookup = types.FunctionDeclaration(
name="check_availability",
description="Checks one item and returns availability.",
behavior="NON_BLOCKING",
parameters={
"type": "OBJECT",
"properties": {"sku": {"type": "STRING"}},
"required": ["sku"],
},
)
config.tools = [types.Tool(function_declarations=[lookup])]
This is the core of Gemini live API tool calling here. The first test uses one bounded argument, structured output, and no side effects.
Send Audio and Return the Tool Result
Inside client.aio.live.connect, I stream PCM with send_realtime_input. On message.tool_call, I persist call.id, start a timeout, run the lookup, and return that ID through send_tool_response. The tool-use documentation defines this contract.
I log public states, function name, sanitized arguments, result class, and elapsed time. Hidden reasoning stays hidden.
Handle Reasoning and Session State Correctly
Treat Turn Completion and Idle State Separately
My states are LISTENING, SPEAKING, WORKING, and IDLE. A filler may return to WORKING; it cannot end the interaction.
That is the practical value of Gemini extended thinking: observable background work without private reasoning in application data.
Keep the Interface Responsive During Background Work
Microphone capture, playback, and tools use separate queues. During IN_PROGRESS, the interface can play audio but cannot submit the same action twice.
Audio is token-billed; transcriptions add text-output charges. I record audio duration, transcription usage, and tool timing. Speed is not the goal. Not breaking flow is.
In the September, 2026 snapshot, paid Live pricing lists $0.005 per input-audio minute and $0.018 per output-audio minute. I do not turn that into a task estimate; transcription, retained context, and tool wait time change the session total.

Recover From Interruptions and Failed Tool Calls
Cancel Active Generation Without Losing Client State
Voice interruption cancels generation and pending calls. Google reports serverContent.interrupted and canceled IDs. I stop playback, clear queued audio, mark the IDs canceled, and keep local business state.
Client content with turn_complete=true also interrupts generation. Already played information remains in session history.
Retry Safely or Fall Back to a Simpler Route
I retry only read-only calls, using a local operation key and attempt limit. Late results for canceled IDs are ignored. A timeout becomes a tool result, not an endless spinner.
After repeated failures, I open Gemini-3.8-live with a client-owned summary. Completed side effects are not replayed. The fallback drops background reasoning.
Validate the Integration Before Production
Log Events, Tool IDs, Timing, and Final Outcomes
My event row contains session ID, handle version, model ID, event type, interaction_status, turnComplete, call ID, interruption, timeout, retry count, and outcome. Sensitive arguments stay out.
The test passes when one request produces one tool execution, one final spoken result, and one IDLE transition.
Test Disconnects, Duplicate Results, and Timeouts
I disconnect during tool execution, resume with the newest handle, inject a duplicate result, delay the tool beyond its deadline, and interrupt during filler audio.
Google documents ten-minute connections and two-hour handle validity in its session-management guide. Context compression does not replace reconnect testing.
FAQ

Can browser clients authenticate with ephemeral Live API tokens?
Yes. A backend mints a restricted token for the browser’s direct WebSocket. Google marks ephemeral tokens as Preview; defaults allow one minute to connect and 30 minutes to send messages.
Does the Live API return input and output transcriptions separately?
Yes. Enable input_audio_transcription and output_audio_transcription for separate fields. Transcription adds charges beyond audio processing.
How long can a resumable Gemini 3.8 Live session remain available?
A resumption token remains valid for two hours after termination. A connection lasts around ten minutes. Different clocks.
Can the Gemini 3.8 Live API use WebRTC instead of WebSockets?
Not natively. Google documents WSS. Partner layers may expose WebRTC while connecting onward to Gemini.
Is Gemini 3.8 Live available through the OpenAI-compatible endpoint?
No documented Live route exists there. Google’s OpenAI compatibility guide covers REST access, not bidirectional Live. Use the GenAI SDK or WebSocket API.
Conclusion
The Gemini 3.8 Live API fits this workflow when speech, tools, and lifecycle remain separate state. The real check is whether interruption, duplicates, and reconnects still produce one accepted outcome.
This is where my documentation-based verification ends.
Previous posts:





