Building a Voice Agent With the Gemini Live API

Choose a thinking level, open an audio session, and keep callers talking during a lookup. Includes Gemini 4 Live pricing, phone integrations and limits.

Published

Tools
  • GGemini Live API
  • GGemini 4 Live
  • GGoogle AI Studio
Building a Voice Agent With the Gemini Live API

A caller asking when the ticket office opens wants a quick answer. A caller who missed a connection wants someone to find another flight and explain the options. As of December 2026, the Gemini Live API can handle both calls with the same voice model, gemini-4-live. The choice you make when opening the session changes both how soon Gemini speaks and how your app knows when the work is done.

Choose a thinking level for the call

On December 2, Google brought Gemini 3.8 Live and Gemini 3.8 Live Extended Thinking together on one endpoint. If you already use the standard model, change the model ID and leave thinking_level out to preserve the familiar turn behavior. If you use Extended Thinking, keep your deeper level and your background tool handling when you change the ID. Google’s release notes · Gemini 4 Live model guide

Google reports that in fast mode Gemini starts speaking more than three times as fast as Gemini 3.8 Live. Its measure is time to first audio. That is the improvement a caller can hear in a greeting or a short answer. A flight search still takes as long as your reservation system needs. Google’s launch post · Where Gemini 4 Live is available

Session settingA call to try it onWhat to listen for
Omitted or MINIMALReception, opening hours, or a single quick status checkDoes the first reply answer the question promptly?
LOWA booking inquiry that needs a lookup while the caller gives a preferenceCan the agent use the returned options and the preference together?
MEDIUMA missed connection that requires comparing flights against an onward bookingDoes the proposed route meet both constraints?
HIGHTechnical support that must reconcile logs, an error code and a configuration changeCan the agent explain which evidence supports the next step?

These are starting points for evaluating your own call types. Google documents one fast mode and a shared protocol for the three deeper levels. It gives no fixed response time for each level. Set the level in the session’s thinking_config. For a queue with mixed requests, choose based on the hardest task the agent is expected to finish. A receptionist who hands complex calls to a specialist can stay on the fast setting. Google’s thinking guide

Open a session and get audio flowing

The Live API carries a conversation over a stateful WebSocket. A backend can relay audio between your app and Gemini. A browser can also stream directly to Gemini, removing the extra hop. Google recommends short-lived ephemeral tokens for a production client connecting directly. The Python example below is the server-side route. Live API overview · What Google AI Studio is for

Opening the audio session in Google’s Python SDK example

model = "gemini-4-live"

config = {"response_modalities": ["AUDIO"]}

async with client.aio.live.connect(model=model, config=config) as session:

print("Session started")

Session started

In Google’s example, client is a genai.Client configured with an API key and API version v1beta. “Session started” is the program’s own print statement. At that point the connection is open and it has played no sound. Inside the connection block, the first input can be as small as this line from the same tutorial.

Python
await session.send_realtime_input(text="Hello, how are you?")

For speech, send chunks of raw 16-bit little-endian PCM at 16 kHz. Receive the reply with async for response in session.receive(), take the audio bytes from the model turn’s part.inline_data.data, and play them at 24 kHz. Getting the playback rate right matters even when the connection and the generated words are fine. Google’s Python session and audio examples

Keep the lookup alive after Gemini speaks

Suppose a travel agent starts a flight search. The caller can hear an acknowledgment while the search is still running. In fast mode, functions can be blocking or non-blocking, and the app can schedule when Gemini uses a returned result. In deeper mode, declare every function with behavior="NON_BLOCKING" and leave function-response scheduling out. A blocking declaration or a scheduling option will produce an error. Live API tool use · Google’s thinking guide

Gemini can finish speaking before the flight search finishesThe deeper-thinking lifecycle in Google’s Seattle flight example
One caller request
Spoken updateGemini acknowledges the search. The utterance ends.
IN_PROGRESSThe app keeps listening for the flight search call.
Tool responseThe client runs the function and returns its result.
IDLEGemini gives the final answer. The interaction ends.

As of Dec 3, 2026 · Source: Google AI Studio, Thinking in the Live API

The integration mistake is treating every turnComplete: true as a cue to tear down the receiver or mark the agent available. That signal closes a turn in fast mode. In deeper mode it can arrive at the end of “Checking flights to Seattle…” while server_content.interaction_status still says IN_PROGRESS. Keep processing messages, return the function result with the original call ID, and wait for IDLE before resetting the interface. An acknowledgment is a good time to show “Searching.” A returned itinerary is the time to read out a flight. Documented message sequence · Background tool calls in Gemini 3.8 Live

Change the job without making the caller start over

A travel desk might begin with timetable inquiries and offer booking tools only after the caller asks to reserve a seat. With send_context_update, the application can replace the system instruction or the available tools over the open connection. Google’s Python examples use these calls, with booking_tools representing declarations your application has prepared.

Python
await session.send_context_update(
    system_instruction="You are a concise VIP concierge."
)
await session.send_context_update(tools=[booking_tools])

Updates take effect in message order. An omitted field keeps its current value. A supplied instruction replaces the initial instruction, so carry forward any directions the agent still needs. A supplied tools list replaces the whole active list, and tools=[] clears it. For a note such as a newly supplied destination, use send_client_content with turn_complete=False to append context quietly. The documented mid-session controls are instructions and tools. Choose reasoning depth at setup. Google’s session management guide

Google’s Antigravity demo shows a related product decision in practice. The speaker can authorize a routine check by voice while other work continues. Google reserves a click for high-impact actions. A travel desk can draw its own boundary at issuing the ticket.

Put the agent on a phone line

Google names LiveKit, Agora and Stream as integration partners for existing phone lines, web apps and live video. Pick the integration that covers the channel your customers already use. The responsibilities on a phone call are distinct. The connection carries the caller’s audio, Gemini detects speech and interruptions, and your application decides what the account tools may do. Google’s partner overview

Gemini 4 Live upgrades telephony voice activity detection. When the caller talks over the agent, the server signals the interruption. The playback client should stop the audio and clear queued chunks. Otherwise the caller may still hear the end of an answer Gemini has already abandoned. For long support calls, plan for reconnection too. Google describes a connection lifetime of around 10 minutes, a GoAway warning before disconnect, and session resumption across connections. Context compression addresses a separate limit on how much conversation the session can retain. Audio and interruption handling · Session lifetime and resumption

Choose the voice your callers will hear

Google offers more than 2,000 preset voices. Audition candidates on the phrases your desk actually says, including a flight code, a date change and a handoff to a colleague. You can browse them in AI Studio or list them with client.voices.list(type_=["prebuilt"]). Google’s example selects Kore in speech_config.voice_config.prebuilt_voice_config.voice_name. For a recorded announcement with a fixed script, the AI Studio text-to-speech workflow covers that separate job. Live voice configuration

If the voice must belong to a particular speaker, custom replication is available to Tier 3 projects. Google requires an authentic reference recording and a separate recording of the same person speaking the required consent statement. Pass the resulting replicated voice ID in speech_config.voice_config.voice. Gemini 4 Live does not support designed voices. Every audio stream the model generates carries Google’s imperceptible SynthID watermark, including speech in a preset voice. Voice replication and consent · Google’s launch post

When a camera changes the call

Proactive Video is in preview in the Live API. The toggle is in Google AI Studio’s Live experience. In code, enable proactivity.proactive_video when configuring the session and send camera frames or screen captures through send_realtime_input. Video proactivity starts off. It requires proactive audio and a turn-coverage setting that includes all video, which the model’s default supplies. Higher frame rates can trigger more generations and increase token use. Proactive Video configuration

Aira’s prototype illustrates when this helps. A person can keep both hands on a task while the assistant describes an item entering view, without having to ask what changed. Google describes a trial alongside Aira’s trained human interpreters. For a support app, give the caller a route to someone who can inspect the scene when the camera misses a detail. Watch Google’s Aira demonstration

If two people already know what they want to say and need an interpreter between them, Google offers the separate gemini-4-live-translate model for speech-to-speech translation across more than 70 languages. Use that path for the interpreter role and Gemini 4 Live for the support agent that needs to look something up. Gemini 4 Live Translate

Price and capacity for a support queue

Google kept the Gemini 3.8 Live token prices. The following paid rates are in US dollars. Google lists the model’s inputs and outputs as free of charge on the free tier. Gemini API pricing

What the session processesPer million tokensGoogle’s per-minute equivalent
Incoming text$0.75–
Incoming audio$3.00$0.005
Incoming images or video$1.00$0.002
Outgoing text$4.50–
Outgoing audio$12.00$0.018

Google includes thinking tokens in output pricing. To budget the model portion, count incoming and outgoing audio separately, then account for the other modalities you use. Applying the outgoing audio rate to the whole time a caller occupies a phone line would misprice the listening portion. Budget your phone connection and external tools separately. If your app already has a dialogue engine and only needs spoken output, compare low-latency text-to-speech APIs.

Project usage tierPublished tokens per minute
Free65,000
Tier 1250,000
Tier 2600,000
Tier 315,000,000

Google lists requests per minute and requests per day as “Not set” in every row for this model. It also says actual capacity may vary. These figures are token allowances. To size a desk, collect the usage metadata in the server messages and measure token use across overlapping calls during a busy period before promising a number of simultaneous lines. Gemini 4 Live rate limits

Which calls should still reach a person?

Start with a queue where the desk can tell whether a call succeeded. For reception, that might mean the caller reached the right department. For rebooking, it means the reservation system returned a confirmed change. Track the first spoken reply and the completed task separately. Fast first audio helps both callers hear that someone is there. Only the second caller needs the agent to stay with unfinished work.

Give a person the case when the booking system and the caller’s receipt disagree, when a fare exception needs approval, or when the caller asks for a colleague. Pass along the request, the options already checked, and any action the system confirmed. That handoff saves the caller from retelling the story and gives the next agent a precise place to resume.

Published
Category
Build
Related Articles
Vercel MCP

Vercel MCP

Connect Claude Code or Codex to Vercel, diagnose a failed build, call a second model, and set up team access with Claude Enterprise-managed auth.Dec 3, 2026Build
LobeChat Is Now LobeHub: What It Does, What It Costs, and How to Start

LobeChat Is Now LobeHub: What It Does, What It Costs, and How to Start

Connect multiple models in LobeHub, add a provider key, and start a local Docker install. Check the license before distributing a modified app.Dec 3, 2026Build
AWS Kiro: What It Is, What It Costs, and How to Start

AWS Kiro: What It Is, What It Costs, and How to Start

How AWS Kiro turns a feature request into a spec, which models and plans you can use, and how to start in the IDE or terminal.Dec 3, 2026Build
What Is OpenRouter? How It Works and How to Start

What Is OpenRouter? How It Works and How to Start

Get an OpenRouter API key, make your first request, and see how provider fallback and data settings change which models your app can use.Dec 3, 2026Build
Antigravity CLI: What It Is, What It Costs, and How to Start

Antigravity CLI: What It Is, What It Costs, and How to Start

Install Google’s agy terminal agent, review your first edit, and run a headless prompt. See who moved from Gemini CLI and what Google’s terms permit.Dec 3, 2026Build
Claude Code Channels

Claude Code Channels

Message a running Claude Code session from your phone. Set up Telegram, connect a Discord team room, and choose who can send requests or approve tools.Dec 2, 2026Build
Claude Worktree

Claude Worktree

Run Claude Code sessions in separate Git worktrees. Start two features, test a pull request, isolate a subagent and decide which files survive cleanup.Dec 2, 2026Build
AgentMail: What It Is, What It Costs, and How to Start

AgentMail: What It Is, What It Costs, and How to Start

Give an AI agent its own email address. See the first inbox call in Python, the free plan’s limits, and when Gmail or SMTP fits better.Dec 2, 2026Build
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.