> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://murf.ai/api/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://murf.ai/api/docs/_mcp/server.

# Build voice agents

> How to build a real-time voice agent with Murf Speech to Text (Finch) and Text to Speech (Falcon 2.1), with framework integrations for LiveKit, Pipecat, and Agora.

A voice agent listens, thinks, and speaks in a loop. Murf covers both ends of that loop: **Speech to Text (Beta)** turns the caller's audio into text, and **Falcon 2.1** turns your LLM's reply into speech as the tokens arrive. Your LLM sits in the middle.

## How the loop works

![Caller audio streams over WebSocket in 20-100 ms frames to Murf Speech to Text. The final transcript goes to your LLM, streamed tokens go to Murf Falcon 2.1, and audio chunks return to the caller.](/api/docs/_fern-files/_img/79f9324373f8bd173efae35d22811903d955c9ed36983b648d0bba6f29c924ef.webp)![](/api/docs/_fern-files/_img/c64440ec877ea87fe9189e9ebdd54872f7ca2c1043c54de1436ddf12b9fc2a71.webp)

The caller perceives the gap between the end of their speech and the first word of the reply. Each hop adds to that gap:

| Hop                             | What controls it                        | Typical figure                                                                                                                                                         |
| ------------------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Speech to Text final transcript | Finch model, frame size, region         | 51 ms p50 final-text delay ([Cekura](https://benchmarks.cekura.ai/stt/murf-finch-global))                                                                              |
| LLM first token                 | Your model and provider                 | Varies by model                                                                                                                                                        |
| Text to Speech first audio      | Region, connection reuse, text chunking | 61–97 ms median by region ([Murf study](https://murf.ai/falcon/benchmarks)); 138 ms mean to first audible audio ([Coval](https://benchmarks.coval.ai/models/falcon-2)) |

## Pick your building blocks

| You need to                                        | Use                                                                                                                            |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Transcribe the caller in real time                 | [Speech to Text streaming](/api/docs/speech-to-text/streaming) over WebSocket                                                  |
| Speak text that arrives token by token from an LLM | [Text to Speech WebSocket](/api/docs/text-to-speech/web-sockets)                                                               |
| Speak a complete sentence or prompt                | [HTTP streaming](/api/docs/text-to-speech/streaming)                                                                           |
| Run inside an agent framework                      | [Pipecat](/api/docs/voice-agents/pipecat), [LiveKit](/api/docs/voice-agents/livekit), or [Agora](/api/docs/voice-agents/agora) |

> **Note**
>
> The LiveKit, Pipecat, and Agora integrations provide Murf as the Text to Speech service. Pair them with Murf Speech to Text through its WebSocket, or with your framework's existing speech recognition.

## Five rules for low latency

1. **Keep one WebSocket open per call.** Send every turn on it. Reusing the connection saves 30–80 ms of handshake per request.
2. **Stream LLM tokens straight to Falcon.** Turn off sentence aggregation in your framework. Falcon splits on punctuation itself, so splitting twice only adds waiting.
3. **Use one `context_id` per turn**, and send `clear` on that context when the caller interrupts. See [Context ID](/api/docs/text-to-speech/web-sockets/context-id).
4. **Run close to Murf.** Use the global endpoint, or the region nearest your agent server. Measure from that server, not a laptop.
5. **Authenticate from your server.** Speech to Text and the Text to Speech WebSocket take your API key, so keep them on the backend. See [API key safety](/api/docs/resources/api-key-safety).

The full checklist is in [Latency Optimization](/api/docs/text-to-speech/latency).

## Write replies for the ear

Your LLM writes every word the caller hears. Markdown, lists, and romanized Hindi all sound wrong when spoken. [Prompting Falcon](/api/docs/voice-agents/prompting-falcon) includes a system prompt block you can paste into your agent, with rules for numbers, codes, names, and pauses.

## Framework guides

#### [LiveKit](/api/docs/voice-agents/livekit)

Use the `livekit-plugins-murf` plugin in an `AgentSession`.

#### [Pipecat](/api/docs/voice-agents/pipecat)

Add Murf TTS to a Pipecat pipeline with `pipecat-murf-tts`.

#### [Agora](/api/docs/voice-agents/agora)

Choose Murf as the TTS vendor in Agora's Conversational AI Engine.