Building phone and voice bots that survive messy real calls

Native audio models that listen and speak in real time are one of the most exciting things Google has shipped for developers. A voice agent that answers a recruitment line, qualifies a lead or books an appointment sounds like a weekend project. Then real calls arrive, and teams report sessions closing unexpectedly, the agent repeating sentences, email addresses captured wrongly, and long text-to-speech outputs that speed up or pick up hiss toward the end.
This article is for developers deciding whether a live voice model is ready for their use case and how to design around its weak spots. It covers the failure modes people describe most, the architecture choices that reduce them, and where a text-only model, such as the keyless one on this site, can still play a role.
Frequently asked questions
What is a native audio or live model?
A model that accepts streaming audio and produces audio directly over a persistent connection, rather than chaining separate speech-to-text, text model and text-to-speech steps. It can feel more natural and responsive, but it is a newer and more complex surface.
How does a live audio pipeline differ from a chained one?
A chained pipeline uses three components you can test and swap separately. A live pipeline merges them, which reduces latency and preserves tone, but makes it harder to inspect or correct what the model heard before it answers.
Why do live sessions disconnect?
Persistent connections can be closed by session time limits, network interruptions, server-side changes or errors in your own event handling. Treat disconnects as normal events and design reconnection and state recovery from day one.
Why does the agent mishear emails and names?
Spelled-out strings, unusual names and numbers are hard for any speech system. Without a confirmation step, small errors pass straight into your records. Read the value back and ask the caller to confirm.
Why does long text-to-speech output degrade?
Very long single generations can drift in pacing or audio quality. Developers often report problems on outputs of several minutes. Generating shorter segments and joining them usually gives more consistent results.
Which is better for production today, live or chained?
It depends on your tolerance for errors. For high-stakes data capture, a chained pipeline with explicit transcripts and checks is easier to make reliable. For conversational experiences where tone matters most, live models are attractive. Many teams prototype live and ship chained for critical steps.
Can free-ai handle audio?
No. free-ai is a text-only model. In a voice system it can only act as the text reasoning step between your own speech recognition and speech synthesis.
Where are the current limits and session rules for Gemini live models?
In Google's official documentation for the Live API. Session lengths, supported audio formats and pricing change, so check there rather than relying on older examples.
Two architectures for voice
Voice agents are built in one of two ways. In a chained pipeline, speech recognition turns audio into text, a language model produces a text reply, and speech synthesis speaks it. In a live pipeline, a single model receives audio and replies in audio over a streaming connection.
Chained pipelines are older and more transparent: every step has an input and output you can log and test. Live pipelines are faster and more natural, handling interruptions and tone better, but put more of the behaviour inside a black box.
There is also a hybrid option. Some teams use a live model for natural conversation but run a separate transcription of the caller's audio in parallel for logging and validation. That costs more but gives you the responsiveness of a live model with a written record you can check.
Latency budget
Callers notice pauses longer than about a second. Chained pipelines add up three latencies, so each component must be fast and streaming. Live models remove the hand-offs, which is their main appeal.
Observability
With a chained pipeline you have a transcript of what the caller said and what the bot intended to say. With a live model, you often have only audio, unless the API also returns text you can log.
The failure modes teams report
Developers building with live audio models describe a recognisable set of problems once they move beyond demos. None of them is unique to one provider; they are what happens when real phone lines, accents and impatient callers meet a new technology.
Works yesterday, fails today
A pipeline that suddenly throws connection-closed errors may be hitting a changed session limit, a model update or a bug in reconnection. Check the provider's changelog and status page, then your own logs, before rewriting code.
Production differs from demos
Demos use quiet rooms, clear speakers and short exchanges. Production calls bring traffic noise, speakerphones, people talking to someone else mid-call and long silences. Record a set of realistic calls with consent and replay them whenever you change models or settings.
- Sessions closing with connection errors after working fine for days
- The agent repeating a sentence or restarting an answer
- Incorrect capture of emails, phone numbers and names
- Long synthesised outputs speeding up or adding noise near the end
- Interruptions handled inconsistently, with the bot talking over the caller

Designing for disconnects
Treat the live connection as disposable. Keep conversation state on your side: what the caller has said, what has been confirmed, which step of the script you are on. When the session drops, open a new one and send a compact summary of that state so the model can continue.
Use exponential backoff for reconnects and cap attempts. If reconnection fails, fall back to a simpler path, such as a recorded message promising a callback, rather than leaving the caller in silence.
Keep a state object
A small dictionary with fields such as name, email, confirmed and step is enough. Update it from transcripts or tool calls, and use it to rebuild context on reconnect.
Log every close reason
Record close codes and messages with timestamps. Patterns, such as drops at a fixed session length, point straight to the cause.
Capturing details correctly
Misheard details are the most damaging failure, because they look like success. A lead qualifier that records a wrong email has lost the lead. Never write a captured value to your system without reading it back.
Ask callers to spell difficult items, read them back in groups, and request a yes or no. For emails, splitting into the part before and after the at sign makes confirmation much easier. Where possible, send a text message or email afterwards with the captured details for the caller to correct.
Validate with code
Run captured values through simple validators: email syntax, phone number length, date ranges. A failed check triggers a polite re-ask instead of a silent error.
Offer a non-voice channel
For complex data such as addresses, offering to send a short form by text message is often faster and more accurate than spelling over a noisy line.

Repetition and interruption handling
Repeated sentences often come from the agent losing track of what it already said after a barge-in or a reconnect. Keeping a short record of the last utterance and telling the model explicitly what it has already said helps. So does a system instruction that forbids restating previous answers unless asked.
Tune voice activity detection carefully. Too sensitive, and background noise interrupts the agent; too sluggish, and callers talk over it. Test with real recordings from your target environment, not studio audio.
Tell the model what it already said
Include the last one or two agent utterances in the instructions after an interruption or reconnect, with a note not to repeat them. This simple step removes much of the looping that callers find most irritating.
Long speech without artefacts
When generating long audio, such as narration or a multi-minute message, developers often report pacing drifting faster toward the end and noise creeping in. A practical workaround is to split the text at sentence or paragraph boundaries, synthesise each piece separately with the same voice settings, and join them with short silences.
Segmenting also makes retries cheap: if one segment sounds wrong, regenerate only that one. And it lets playback start before the whole script has been synthesised.
If you are evaluating several speech providers because of quality problems, use the same scripts and voice settings across all of them, and listen on the devices your users have, such as phone earpieces and cheap speakers. Differences that are obvious on studio headphones may vanish on a phone line, and the opposite also happens. Before switching providers, it is also worth reviewing whether reasoning is slowing the text step, since a slow reply can be mistaken for a speech problem.
Keep voice settings fixed
Use the same voice, speed and format for every segment. Varying any of them produces audible seams when the pieces are joined.
import re
from openai import OpenAI
# Text step of a chained voice pipeline: stream a reply and cut it
# into sentences that a TTS engine can speak one at a time.
client = OpenAI(base_url="https://api.apifreegemini.com/v1", api_key="none")
def sentences(user_text):
stream = client.chat.completions.create(
model="free-ai", stream=True, max_tokens=300,
messages=[{"role": "system", "content": "You are a brief, friendly phone assistant. Short sentences."},
{"role": "user", "content": user_text}],
)
buf = ""
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
buf += chunk.choices[0].delta.content
parts = re.split(r"(?<=[.!?])\s+", buf)
for done in parts[:-1]:
yield done
buf = parts[-1]
if buf.strip():
yield buf
for s in sentences("Hi, I'd like to book a viewing for Saturday."):
print("TTS ->", s) # send each sentence to your speech engine here
Where a text-only model fits
APIFreeGemini is not affiliated with Google, and its free-ai model is not a Gemini live or audio model. It is an independent, text-only open-weight model of about 35B parameters. In a chained voice prototype, it can sit between your own speech recognition and speech synthesis as the reasoning step, which is useful for testing scripts and dialogue logic without a key.
For a production phone line it has clear limits: one request per second per IP, two in parallel, no SLA, and a stateless API where you manage all context. Those are acceptable for a prototype or an internal tool, not for a customer hotline. If your bot also needs to run in automation tools, the guide to no-code workflows without keys shows the text side in n8n-style flows.
Prototype the dialogue in text first
Write and test the conversation flow as a text chat before adding audio. Most logic bugs, such as skipped confirmations, show up just as clearly in text and are far cheaper to fix there.
A readiness checklist
Before putting a voice agent in front of real callers, run through a short list. If you cannot tick most items, keep humans in the loop for now.
Start with a narrow script
The first production version should handle one task well, such as booking a viewing or taking a callback request, with a human handover for everything else. Broad open-ended agents multiply the failure modes described above. Expand the scope only when logs show the narrow version is reliable.
- Reconnection with state recovery tested by killing sessions mid-call
- Every captured value read back and validated
- Transcripts or text logs stored for review, with consent where required
- A fallback path when the model or connection fails
- Tests with real background noise, accents and interruptions
- A clear way for callers to reach a person

Send a test prompt to the keyless free-ai endpoint from the home page, no sign-up or key required.
Read also
- Should you build on Gemini Flash or Flash-Lite for your app?
- Gemini CLI vs Antigravity vs OpenCode: which terminal agent fits?
- Are cheap Gemini Pro links and resold AI plans safe to buy?
- Can a Gemini subscription or CLI login lead to surprise API charges?
- Does a bigger context window really give you better answers?