CLAUDE LABJP
MCP — Support for the 2026-07-28 spec is rolling out across Claude. The protocol moves from bidirectional and stateful to request/response, so MCP servers can now live on serverless and edge infrastructureEXTENSIONS — Three official extensions have landed: MCP Apps for server-rendered UI, Tasks for async and long-running work, and Enterprise Managed Auth for IdP-based org-wide provisioningADOPTION — MCP passed 400 million monthly SDK downloads, roughly 4x growth this year, settling into its role as the standard way to connect agents to applicationsQUOTA — Today, August 19, is the last day of the 50 percent weekly usage boost for Claude Code subscribers. If you have long agent runs queued, this is the windowPRICING — Claude Sonnet 5's introductory rate of $2 per million input tokens and $10 output ends August 31; standard pricing of $3 and $15 takes over on September 1, twelve days outFIX — A bug where MCP v2 connections endlessly reopened subscriptions against servers with fixed timeouts is resolved, and a forward_user_identity setting was added for user attributionMCP — Support for the 2026-07-28 spec is rolling out across Claude. The protocol moves from bidirectional and stateful to request/response, so MCP servers can now live on serverless and edge infrastructureEXTENSIONS — Three official extensions have landed: MCP Apps for server-rendered UI, Tasks for async and long-running work, and Enterprise Managed Auth for IdP-based org-wide provisioningADOPTION — MCP passed 400 million monthly SDK downloads, roughly 4x growth this year, settling into its role as the standard way to connect agents to applicationsQUOTA — Today, August 19, is the last day of the 50 percent weekly usage boost for Claude Code subscribers. If you have long agent runs queued, this is the windowPRICING — Claude Sonnet 5's introductory rate of $2 per million input tokens and $10 output ends August 31; standard pricing of $3 and $15 takes over on September 1, twelve days outFIX — A bug where MCP v2 connections endlessly reopened subscriptions against servers with fixed timeouts is resolved, and a forward_user_identity setting was added for user attribution
Articles/API & SDK
API & SDK/2026-03-28Advanced

Production Voice Agents with Claude API: Latency Budgets, Cost, and Fallbacks

Orchestrating Whisper/Deepgram, Claude API, and TTS into a voice agent that survives production — latency budgets measured on Cloudflare Workers and Cloud Run, per-session cost math, three-tier fallbacks, and barge-in handling.

Claude API117voice agentsspeech-to-texttext-to-speechproduction architecture

Premium Article

The 300ms that broke the conversation

The first time I put a voice agent in front of real users, the replies that had felt snappy in testing sounded noticeably slow on a real phone. The measurement said p95 was 1.8 seconds — only 300ms over budget.

Listeners still felt the pause. They repeated themselves, the repeat produced a duplicate transcript, and the duplicate made the next turn slower. A small overshoot on paper, a broken conversation in practice.

The hard part of voice agents is not model quality. It is how you spend time. Claude API handles the language reasoning; speech recognition and speech synthesis live in separate services, and milliseconds pile up at every seam between them.

What follows is a full stack — Whisper or Deepgram for input, Claude API for reasoning, several TTS engines for output — organized around four decisions: latency budget, cost math, failover, and monitoring. Everything is TypeScript/Node.js, with code you can run as written.


Voice Agent Architecture Overview

A production voice agent system spans multiple integrated layers:

┌─────────────────────────────────────────────────────────────┐
│              Client Layer (Web / Mobile)                    │
└─────────────────────┬───────────────────────────────────────┘
                      │ WebSocket / HTTP
┌─────────────────────▼───────────────────────────────────────┐
│           API Gateway / Auth / Rate Limiting                │
└─────────────────────┬───────────────────────────────────────┘
                      │
    ┌─────────────────┼─────────────────┐
    │                 │                 │
    ▼                 ▼                 ▼
┌─────────┐   ┌─────────────┐   ┌─────────────┐
│ STT     │   │ Response    │   │ TTS Engine  │
│ (Whisper│   │ Generation  │   │ (Multi-     │
│/Deepgram)  │ (Claude API) │   │  Provider)  │
└─────────┘   └─────────────┘   └─────────────┘
                      │
    ┌─────────────────┼─────────────────┐
    │                 │                 │
    ▼                 ▼                 ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│Cache (Redis) │ │ Conversation │ │Analytics &   │
│              │ │ Storage      │ │Logging       │
│              │ │(PostgreSQL)  │ │              │
└──────────────┘ └──────────────┘ └──────────────┘

Core responsibilities of each layer:

  • STT (Speech-to-Text): Whisper for high accuracy and offline capability; Deepgram for low-latency streaming
  • Response Generation: Claude API with streaming support and conversation history
  • TTS (Text-to-Speech): Multi-provider support (Google Cloud, ElevenLabs, Amazon Polly) with failover
  • State Management: Session persistence, conversation history, user context
  • Infrastructure: Caching, rate limiting, monitoring, logging

Let's build each piece methodically, starting with speech recognition.


Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
How I split a 1500ms voice-to-voice latency budget into STT 600ms / Claude Haiku 400ms / TTS 400ms, and compressed real-world p50 to 910ms with Deepgram Streaming
Reduced per-session cost from $0.024 to $0.011 across 4 specific decisions, with the Sonnet routing rule that finally worked after Sonnet-judges-itself failed
Why Cloudflare Workers cannot host the inference layer, and the Durable Objects + Cloud Run split I run in production with signed JWT session tokens
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-08-14
Move the Prompt Tools API Into Your Own Scripts Before Workbench Closes on August 17
The legacy Workbench and three experimental prompt endpoints shut down on August 17, 2026. Here is how to count what actually depends on them, plus working local replacements for templatize_prompt and improve_prompt with real output.
API & SDK2026-08-01
Swapping Tools Mid-Conversation Without Losing Your Prompt Cache
Tools can now be added and removed between turns, but the tool block sits at the very front of the cache prefix. I measured 12 mutation patterns with fingerprints and built a stable-core plus volatile-tail registry with a guard that refuses unsafe changes.
API & SDK2026-07-13
Full-Size or Downscaled? A Per-Image Resolution Rule for Opus 4.7's High-Resolution Vision
Opus 4.7 finally read the fine texture in my wallpapers, so I sent everything at full size. My weekly image tokens jumped 2.4x. Here is the preflight that decides resolution and model per image, with the measured savings.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →