ElevenLabs Speech Engine
Speech Engine is the server-side product that lets you keep your existing
agent (any LLM/workflow that produces text) and bolt a real-time voice
interface in front of it. ElevenLabs runs everything between the microphone
and the LLM call; you only handle "transcript in, reply text out."
[Browser / Mobile] [ElevenLabs Cloud] [Your Server]
│ │ │
│ 1. signed URL request ─────▶ │ │
│ ◀──── signed URL (15 min) ─ │ │
│ 2. WebRTC audio ──────────▶ │ │
│ │ 3. STT + VAD + turn detect │
│ │ 4. WS open ─────────────────▶│
│ │ 5. user_transcript event │
│ │ + AbortSignal (TS) / │
│ │ asyncio cancel (Py) │
│ │ │ 6. LLM call (stream)
│ │ 7. session.sendResponse() ◀──│
│ │ 8. TTS │
│ 9. WebRTC audio ◀────────── │ │
│ │ │
│ — user interrupts — ───────▶ │ │
│ │ 10. signal aborted / │
│ │ in-flight LLM cancelled │
│ │ 11. new user_transcript ────▶│
The SDK gives you the WebSocket server (speechEngine.attach(),
SpeechEngine.Server, Python engine.serve() / engine.create_session())
plus client libraries (@elevenlabs/react, @elevenlabs/client,
@elevenlabs/react-native) for the user-facing side.
Speech Engine vs ElevenAgents — pick the right product first
These look similar in marketing but are different runtime paths. Choosing
the wrong one means rewriting both server and dashboard config.
| You want… |
Use |
| Keep your existing agent / LLM / workflow, just add voice |
Speech Engine (this skill) |
| ElevenLabs to host the LLM, knowledge base, tools, telephony |
ElevenAgents (different product) |
| ElevenAgents to call your LLM endpoint for token generation only |
ElevenAgents with "Custom LLM" — also different from Speech Engine |
Engine IDs are seng_*. Agent IDs are agent_*. If the user shows you an
agent_* ID and a server URL setting, they may actually be using
"Custom LLM" under ElevenAgents (an OpenAI-compatible endpoint contract)
rather than Speech Engine (which uses a WebSocket protocol that the SDK
implements for you). Confirm before writing code — the two are not
interchangeable.
The four moving parts
- Server (this is your code) — a WebSocket endpoint that receives
transcripts and streams text back. Node or Python SDK does the protocol.
- Dashboard config — create a Speech Engine in the ElevenLabs dashboard,
note its
seng_* ID, set the server URL it should connect to, pick the
voice and TTS model.
- Client (browser/mobile) — uses
@elevenlabs/react, @elevenlabs/client,
or @elevenlabs/react-native to open a WebRTC audio session against
ElevenLabs (not against your server directly).
- Auth bridge — your server generates short-lived signed URLs so the
client can connect without ever seeing your
ELEVENLABS_API_KEY.
Skip any reference below that doesn't match the current task — every file
is loadable on its own.
| Reference |
Load when… |
| references/server-typescript.md |
Writing the Node server (speechEngine.attach, SpeechEngine.Server, OpenAI/Anthropic/Gemini stream forwarding, AbortSignal interrupt handling, Express/Fastify/Next.js integration) |
| references/server-python.md |
Writing the Python server (AsyncElevenLabs.speech_engine, engine.serve(), FastAPI/Starlette engine.create_session(), asyncio.CancelledError interrupt handling, SpeechEngineServer) |
| references/client-web.md |
Building the browser UI (ConversationProvider, granular hooks, Conversation.startSession, signed-URL flow, public vs private agents, audio device controls, frequency-data visualizations) |
| references/client-mobile.md |
React Native — LiveKit peer deps, iOS NSMicrophoneUsageDescription, Android RECORD_AUDIO, Expo dev build requirement |
| references/full-duplex.md |
Tuning the conversational feel — barge-in/interruption handling, turn eagerness (Eager/Normal/Patient), turn timeout, what is and isn't configurable, latency optimization (Flash/Turbo model picks, regional co-location, sub-second targets) |
| references/ui-patterns.md |
Building the conversational UI — status/mode indicators, mic visualization, transcript rendering, sendUserMessage / sendContextualUpdate, conversation overrides, client tools, the embeddable widget |
| references/dashboard-and-deployment.md |
Dashboard setup, voice/model selection, local dev with ngrok, production deployment, public vs private agent auth, signed URL generation |
Minimum viable conversation
Server (TypeScript, attach to Express):
import express from "express";
import { createServer } from "http";
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import OpenAI from "openai";
const app = express();
const httpServer = createServer(app);
const elevenlabs = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY });
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
// 1. Speech Engine WS endpoint — ElevenLabs connects in here per conversation
// attach() is synchronous; it returns a handle, not a Promise.
elevenlabs.speechEngine.attach("seng_123", httpServer, "/api/speech-engine/ws", {
async onTranscript(transcript, signal, session) {
const stream = await openai.responses.create(
{
model: "gpt-4o",
input: transcript.map(m => ({
role: m.role === "agent" ? "assistant" : m.role, // <-- role mapping
content: m.content,
})),
stream: true,
},
{ signal }, // <-- barge-in cancels LLM
);
session.sendResponse(stream); // SDK extracts text
},
});
// 2. Signed-URL endpoint — client calls this to get a 15-min token
app.get("/api/voice/signed-url", async (_req, res) => {
const url = await elevenlabs.conversationalAi.conversations.getSignedUrl({
agentId: "agent_abc",
});
res.json({ signedUrl: url });
});
httpServer.listen(3000);
Client (React):
import { ConversationProvider, useConversationControls, useConversationStatus, useConversationMode } from "@elevenlabs/react";
function App() {
return (
<ConversationProvider>
<VoiceUI />
</ConversationProvider>
);
}
function VoiceUI() {
const { startSession, endSession } = useConversationControls();
const { status } = useConversationStatus();
const { isSpeaking } = useConversationMode();
const start = async () => {
const { signedUrl } = await fetch("/api/voice/signed-url").then(r => r.json());
startSession({ signedUrl });
};
return (
<>
<p>Status: {status} {isSpeaking && "(agent speaking)"}</p>
<button
<button => endSession()}>Stop</button>
</>
);
}
That's a full-duplex voice loop in front of your existing agent. The
signal is the only thing wired in for barge-in — the SDK does the rest.
Critical conventions and gotchas
Trip-wires for an agent who hasn't used Speech Engine before. Skim before
writing code.
transcript[i].role is 'user' | 'agent', not 'user' | 'assistant'.
OpenAI/Anthropic/Gemini expect 'assistant'. Map agent → assistant when
you forward the history, or the model will see a malformed conversation
and answer worse.
- In TypeScript, you MUST pass
{ signal } to the LLM SDK call. Without
it, barge-in only stops audio playback — the LLM keeps generating, you keep
paying tokens, and the next turn fights stale context. OpenAI, Anthropic,
and Vercel ai SDK all accept an AbortSignal option.
- In Python, barge-in raises
asyncio.CancelledError inside your handler.
Let it propagate. Don't wrap await session.send_response(...) in
try/except Exception that swallows cancellation, or you'll leak in-flight
LLM requests.
- Never put your
ELEVENLABS_API_KEY in client code. The browser asks
your server for a signedUrl (WebSocket) or conversationToken (WebRTC).
Tokens are valid for 15 minutes — the session can run longer, but the
initial connect must happen inside that window.
session.sendResponse() auto-detects OpenAI / Anthropic / Gemini
streams. You can pass the raw await openai.responses.create({ stream: true })
result directly — no manual extraction. Strings and arbitrary async
iterables of strings also work.
- The server's WebSocket auth header (
X-Elevenlabs-Speech-Engine-Authorization)
is verified automatically by both attach() and SpeechEngine.Server,
using apiKey from options or ELEVENLABS_API_KEY env. Don't add your
own auth on the path — you'll fight the SDK.
- VAD thresholds, interrupt eagerness, silence detection are NOT
per-conversation API knobs. They live in the dashboard ("Conversation
flow" → turn eagerness Eager/Normal/Patient, turn timeout 1–30s). If a
reviewer asks "tune the interrupt sensitivity," that's a dashboard change,
not code.
- React Native requires Expo dev build, not Expo Go. WebRTC needs native
modules (
@livekit/react-native, @livekit/react-native-webrtc). Tell the
user up front if they're on Expo Go — they need to switch.
ConversationProvider is mandatory before any conversation hook.
Calling useConversationControls() outside it throws at render. Wrap at
the app root or the smallest subtree that contains the voice UI.
- Prefer the granular hooks for performance.
useConversation() (the
combined hook) re-renders on every state change in any sub-context.
useConversationStatus, useConversationMode, useConversationInput,
useConversationFeedback each subscribe to only their slice — use them
in leaf components.
Status has four values, not three: 'disconnected' | 'connecting' | 'connected' | 'disconnecting'. Don't forget 'disconnecting'
when rendering connection state — typically render it like 'connecting'
(spinner) but with a "hanging up" label.
onAudio payload is base64-encoded text, not a Uint8Array. If you
need bytes, decode it: Uint8Array.from(atob(base64Audio), c => c.charCodeAt(0)).
Most apps don't need this — audio playback is handled by the SDK.
- The token method is
getWebrtcToken (TS) / get_webrtc_token (Py),
but the client-side option you pass into startSession is still spelled
conversationToken. Old docs and tutorials may say
getConversationToken — that name no longer exists.
- Local dev needs a tunnel. ElevenLabs connects INTO your server, so
localhost:3000 is not reachable. ngrok http 3000 (or Cloudflare Tunnel,
Tailscale Funnel, etc.); paste the public URL into the Speech Engine's
server URL field in the dashboard. The tunnel must stay up for the
duration of testing.
- Voice/model picks dominate latency.
eleven_flash_v2_5 gives ~135 ms
end-to-end first-byte audio; eleven_multilingual_v2 is higher quality
but slower. Default to Flash for chat/assistant feel, Multilingual v2
only when audio quality is non-negotiable. See
full-duplex.md.
sendContextualUpdate(text) vs sendUserMessage(text) —
contextual updates are background info the agent receives but does not
reply to (e.g., "user just navigated to checkout"). User messages prompt
a reply (e.g., a typed message in a chat fallback). Don't confuse them
or the agent will start narrating page navigations.
Diagnostics first
When voice "doesn't work", check in this order:
- Does your server's WS receive
init then user_transcript? Add
onInit and a log in onTranscript. No init = ElevenLabs can't reach
your URL (tunnel down, wrong path, or auth header rejected). No
user_transcript = client never connected (signed URL expired? wrong
agent ID? mic permission denied?).
- Does
session.sendResponse(stream) see anything? Log
for await (const chunk of stream) once before passing — confirms the
LLM is actually streaming.
- Browser DevTools → Console for
onError / onDebug output. The
client SDK surfaces auth, network, and audio errors there. Use
debug: true in the React hook options. Inspect
onDisconnect(details) — details.reason is 'error' | 'agent' | 'user'
and tells you who closed (the agent server-side, the user clicking End,
or a fatal error).
onVadScore callback — if it's never firing, the mic isn't capturing.
Check getUserMedia permission and changeInputDevice() selection.
onModeChange — confirms the agent is transitioning
listening → speaking → listening. If stuck in listening, your server
isn't returning a response.
Picking the right next reference
- "Write the server" →
server-typescript.md or server-python.md
- "Build the browser UI" →
client-web.md
- "Build the mobile app" →
client-mobile.md
- "Conversation feels laggy / agent talks over me / interrupts me too eagerly"
→
full-duplex.md
- "Need transcript bubbles, mic indicator, send a typed message, push
background context" →
ui-patterns.md
- "Where do I configure the engine / signed URLs / ngrok / production
deploy" →
dashboard-and-deployment.md
1---2name: elevenlabs-speech-engine3description: ElevenLabs Speech Engine — the SDK for giving a voice interface to a custom agent you host yourself (your existing chat agent, LangGraph workflow, containerized LLM service, etc.). ElevenLabs runs the audio pipeline (STT, turn detection, VAD, TTS, barge-in); your server receives transcripts over a WebSocket and streams text replies back. Use when wiring an existing non-ElevenLabs agent to voice, when the user mentions "Speech Engine", `seng_*` engine IDs, `@elevenlabs/elevenlabs-js` `speechEngine.attach()` / `SpeechEngine.Server`, Python `AsyncElevenLabs.speech_engine`, or full-duplex voice with bring-your-own-LLM. Also covers the matching client SDKs (`@elevenlabs/client`, `@elevenlabs/react`, `@elevenlabs/react-native`, the convai widget) for the browser/mobile side. Do NOT use this skill for ElevenAgents (fully hosted agent platform — different product, see distinction below) or plain TTS / STT calls.4---56# ElevenLabs Speech Engine78Speech Engine is the **server-side** product that lets you keep your existing9agent (any LLM/workflow that produces text) and bolt a real-time voice10interface in front of it. ElevenLabs runs everything between the microphone11and the LLM call; you only handle "transcript in, reply text out."1213```14[Browser / Mobile] [ElevenLabs Cloud] [Your Server]15 │ │ │16 │ 1. signed URL request ─────▶ │ │17 │ ◀──── signed URL (15 min) ─ │ │18 │ 2. WebRTC audio ──────────▶ │ │19 │ │ 3. STT + VAD + turn detect │20 │ │ 4. WS open ─────────────────▶│21 │ │ 5. user_transcript event │22 │ │ + AbortSignal (TS) / │23 │ │ asyncio cancel (Py) │24 │ │ │ 6. LLM call (stream)25 │ │ 7. session.sendResponse() ◀──│26 │ │ 8. TTS │27 │ 9. WebRTC audio ◀────────── │ │28 │ │ │29 │ — user interrupts — ───────▶ │ │30 │ │ 10. signal aborted / │31 │ │ in-flight LLM cancelled │32 │ │ 11. new user_transcript ────▶│33```3435The SDK gives you the WebSocket server (`speechEngine.attach()`,36`SpeechEngine.Server`, Python `engine.serve()` / `engine.create_session()`)37plus client libraries (`@elevenlabs/react`, `@elevenlabs/client`,38`@elevenlabs/react-native`) for the user-facing side.3940## Speech Engine vs ElevenAgents — pick the right product first4142These look similar in marketing but are different runtime paths. Choosing43the wrong one means rewriting both server and dashboard config.4445| You want… | Use |46|-----------|-----|47| Keep your existing agent / LLM / workflow, just add voice | **Speech Engine** (this skill) |48| ElevenLabs to host the LLM, knowledge base, tools, telephony | **ElevenAgents** (different product) |49| ElevenAgents to call your LLM endpoint for token generation only | ElevenAgents with "Custom LLM" — also different from Speech Engine |5051Engine IDs are `seng_*`. Agent IDs are `agent_*`. If the user shows you an52`agent_*` ID and a server URL setting, they may actually be using53"Custom LLM" under ElevenAgents (an OpenAI-compatible endpoint contract)54rather than Speech Engine (which uses a WebSocket protocol that the SDK55implements for you). Confirm before writing code — the two are not56interchangeable.5758## The four moving parts59601. **Server (this is your code)** — a WebSocket endpoint that receives61 transcripts and streams text back. Node or Python SDK does the protocol.622. **Dashboard config** — create a Speech Engine in the ElevenLabs dashboard,63 note its `seng_*` ID, set the server URL it should connect to, pick the64 voice and TTS model.653. **Client (browser/mobile)** — uses `@elevenlabs/react`, `@elevenlabs/client`,66 or `@elevenlabs/react-native` to open a WebRTC audio session against67 ElevenLabs (not against your server directly).684. **Auth bridge** — your server generates short-lived **signed URLs** so the69 client can connect without ever seeing your `ELEVENLABS_API_KEY`.7071Skip any reference below that doesn't match the current task — every file72is loadable on its own.7374| Reference | Load when… |75|-----------|-----------|76| [references/server-typescript.md](references/server-typescript.md) | Writing the Node server (`speechEngine.attach`, `SpeechEngine.Server`, OpenAI/Anthropic/Gemini stream forwarding, AbortSignal interrupt handling, Express/Fastify/Next.js integration) |77| [references/server-python.md](references/server-python.md) | Writing the Python server (`AsyncElevenLabs.speech_engine`, `engine.serve()`, FastAPI/Starlette `engine.create_session()`, `asyncio.CancelledError` interrupt handling, `SpeechEngineServer`) |78| [references/client-web.md](references/client-web.md) | Building the browser UI (`ConversationProvider`, granular hooks, `Conversation.startSession`, signed-URL flow, public vs private agents, audio device controls, frequency-data visualizations) |79| [references/client-mobile.md](references/client-mobile.md) | React Native — LiveKit peer deps, iOS `NSMicrophoneUsageDescription`, Android `RECORD_AUDIO`, Expo dev build requirement |80| [references/full-duplex.md](references/full-duplex.md) | Tuning the conversational feel — barge-in/interruption handling, turn eagerness (Eager/Normal/Patient), turn timeout, what is and isn't configurable, latency optimization (Flash/Turbo model picks, regional co-location, sub-second targets) |81| [references/ui-patterns.md](references/ui-patterns.md) | Building the conversational UI — status/mode indicators, mic visualization, transcript rendering, `sendUserMessage` / `sendContextualUpdate`, conversation overrides, client tools, the embeddable widget |82| [references/dashboard-and-deployment.md](references/dashboard-and-deployment.md) | Dashboard setup, voice/model selection, local dev with ngrok, production deployment, public vs private agent auth, signed URL generation |8384## Minimum viable conversation8586**Server (TypeScript, attach to Express):**8788```ts89import express from "express";90import { createServer } from "http";91import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";92import OpenAI from "openai";9394const app = express();95const httpServer = createServer(app);9697const elevenlabs = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY });98const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });99100// 1. Speech Engine WS endpoint — ElevenLabs connects in here per conversation101// attach() is synchronous; it returns a handle, not a Promise.102elevenlabs.speechEngine.attach("seng_123", httpServer, "/api/speech-engine/ws", {103 async onTranscript(transcript, signal, session) {104 const stream = await openai.responses.create(105 {106 model: "gpt-4o",107 input: transcript.map(m => ({108 role: m.role === "agent" ? "assistant" : m.role, // <-- role mapping109 content: m.content,110 })),111 stream: true,112 },113 { signal }, // <-- barge-in cancels LLM114 );115 session.sendResponse(stream); // SDK extracts text116 },117});118119// 2. Signed-URL endpoint — client calls this to get a 15-min token120app.get("/api/voice/signed-url", async (_req, res) => {121 const url = await elevenlabs.conversationalAi.conversations.getSignedUrl({122 agentId: "agent_abc",123 });124 res.json({ signedUrl: url });125});126127httpServer.listen(3000);128```129130**Client (React):**131132```tsx133import { ConversationProvider, useConversationControls, useConversationStatus, useConversationMode } from "@elevenlabs/react";134135function App() {136 return (137 <ConversationProvider>138 <VoiceUI />139 </ConversationProvider>140 );141}142143function VoiceUI() {144 const { startSession, endSession } = useConversationControls();145 const { status } = useConversationStatus();146 const { isSpeaking } = useConversationMode();147148 const start = async () => {149 const { signedUrl } = await fetch("/api/voice/signed-url").then(r => r.json());150 startSession({ signedUrl });151 };152153 return (154 <>155 <p>Status: {status} {isSpeaking && "(agent speaking)"}</p>156 <button onClick={start}>Talk</button>157 <button onClick={() => endSession()}>Stop</button>158 </>159 );160}161```162163That's a full-duplex voice loop in front of your existing agent. The164`signal` is the only thing wired in for barge-in — the SDK does the rest.165166## Critical conventions and gotchas167168Trip-wires for an agent who hasn't used Speech Engine before. Skim before169writing code.170171- **`transcript[i].role` is `'user' | 'agent'`, not `'user' | 'assistant'`.**172 OpenAI/Anthropic/Gemini expect `'assistant'`. Map `agent → assistant` when173 you forward the history, or the model will see a malformed conversation174 and answer worse.175- **In TypeScript, you MUST pass `{ signal }` to the LLM SDK call.** Without176 it, barge-in only stops audio playback — the LLM keeps generating, you keep177 paying tokens, and the next turn fights stale context. OpenAI, Anthropic,178 and Vercel `ai` SDK all accept an `AbortSignal` option.179- **In Python, barge-in raises `asyncio.CancelledError` inside your handler.**180 Let it propagate. Don't wrap `await session.send_response(...)` in181 `try/except Exception` that swallows cancellation, or you'll leak in-flight182 LLM requests.183- **Never put your `ELEVENLABS_API_KEY` in client code.** The browser asks184 your server for a `signedUrl` (WebSocket) or `conversationToken` (WebRTC).185 Tokens are valid for 15 minutes — the **session** can run longer, but the186 initial connect must happen inside that window.187- **`session.sendResponse()` auto-detects OpenAI / Anthropic / Gemini188 streams.** You can pass the raw `await openai.responses.create({ stream: true })`189 result directly — no manual extraction. Strings and arbitrary async190 iterables of strings also work.191- **The server's WebSocket auth header (`X-Elevenlabs-Speech-Engine-Authorization`)192 is verified automatically** by both `attach()` and `SpeechEngine.Server`,193 using `apiKey` from options or `ELEVENLABS_API_KEY` env. Don't add your194 own auth on the path — you'll fight the SDK.195- **VAD thresholds, interrupt eagerness, silence detection are NOT196 per-conversation API knobs.** They live in the dashboard ("Conversation197 flow" → turn eagerness Eager/Normal/Patient, turn timeout 1–30s). If a198 reviewer asks "tune the interrupt sensitivity," that's a dashboard change,199 not code.200- **React Native requires Expo dev build, not Expo Go.** WebRTC needs native201 modules (`@livekit/react-native`, `@livekit/react-native-webrtc`). Tell the202 user up front if they're on Expo Go — they need to switch.203- **`ConversationProvider` is mandatory before any conversation hook.**204 Calling `useConversationControls()` outside it throws at render. Wrap at205 the app root or the smallest subtree that contains the voice UI.206- **Prefer the granular hooks for performance.** `useConversation()` (the207 combined hook) re-renders on every state change in any sub-context.208 `useConversationStatus`, `useConversationMode`, `useConversationInput`,209 `useConversationFeedback` each subscribe to only their slice — use them210 in leaf components.211- **`Status` has four values**, not three: `'disconnected' | 'connecting' | 'connected' | 'disconnecting'`. Don't forget `'disconnecting'`212 when rendering connection state — typically render it like `'connecting'`213 (spinner) but with a "hanging up" label.214- **`onAudio` payload is base64-encoded text**, not a `Uint8Array`. If you215 need bytes, decode it: `Uint8Array.from(atob(base64Audio), c => c.charCodeAt(0))`.216 Most apps don't need this — audio playback is handled by the SDK.217- **The token method is `getWebrtcToken` (TS) / `get_webrtc_token` (Py)**,218 but the client-side option you pass into `startSession` is still spelled219 `conversationToken`. Old docs and tutorials may say220 `getConversationToken` — that name no longer exists.221- **Local dev needs a tunnel.** ElevenLabs connects INTO your server, so222 `localhost:3000` is not reachable. `ngrok http 3000` (or Cloudflare Tunnel,223 Tailscale Funnel, etc.); paste the public URL into the Speech Engine's224 server URL field in the dashboard. The tunnel must stay up for the225 duration of testing.226- **Voice/model picks dominate latency.** `eleven_flash_v2_5` gives ~135 ms227 end-to-end first-byte audio; `eleven_multilingual_v2` is higher quality228 but slower. Default to Flash for chat/assistant feel, Multilingual v2229 only when audio quality is non-negotiable. See230 [full-duplex.md](references/full-duplex.md).231- **`sendContextualUpdate(text)` vs `sendUserMessage(text)`** —232 contextual updates are background info the agent receives but does not233 reply to (e.g., "user just navigated to checkout"). User messages prompt234 a reply (e.g., a typed message in a chat fallback). Don't confuse them235 or the agent will start narrating page navigations.236237## Diagnostics first238239When voice "doesn't work", check in this order:2402411. **Does your server's WS receive `init` then `user_transcript`?** Add242 `onInit` and a log in `onTranscript`. No `init` = ElevenLabs can't reach243 your URL (tunnel down, wrong path, or auth header rejected). No244 `user_transcript` = client never connected (signed URL expired? wrong245 agent ID? mic permission denied?).2462. **Does `session.sendResponse(stream)` see anything?** Log247 `for await (const chunk of stream)` once before passing — confirms the248 LLM is actually streaming.2493. **Browser DevTools → Console** for `onError` / `onDebug` output. The250 client SDK surfaces auth, network, and audio errors there. Use251 `debug: true` in the React hook options. Inspect252 `onDisconnect(details)` — `details.reason` is `'error' | 'agent' | 'user'`253 and tells you who closed (the agent server-side, the user clicking End,254 or a fatal error).2554. **`onVadScore`** callback — if it's never firing, the mic isn't capturing.256 Check `getUserMedia` permission and `changeInputDevice()` selection.2575. **`onModeChange`** — confirms the agent is transitioning258 `listening → speaking → listening`. If stuck in `listening`, your server259 isn't returning a response.260261## Picking the right next reference262263- "Write the server" → `server-typescript.md` or `server-python.md`264- "Build the browser UI" → `client-web.md`265- "Build the mobile app" → `client-mobile.md`266- "Conversation feels laggy / agent talks over me / interrupts me too eagerly"267 → `full-duplex.md`268- "Need transcript bubbles, mic indicator, send a typed message, push269 background context" → `ui-patterns.md`270- "Where do I configure the engine / signed URLs / ngrok / production271 deploy" → `dashboard-and-deployment.md`