> ## Documentation Index
> Fetch the complete documentation index at: https://www.vobiz.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sprag + Vobiz with Pipecat | Voice Agents on Phone Calls

> Answer Vobiz phone calls with Sprag's speech and language models in Pipecat. Rhythm hears the caller, Symphony replies, and Chorus speaks on the call.

[Sprag](https://sprag.ai/) builds speech and language models for voice agents. Together with Vobiz, they give your [Pipecat](https://www.vobiz.ai/docs/integrations/pipecat.md) agent a phone number: Vobiz carries the call, and Sprag listens, thinks and speaks.

**Source code:** [vobiz-ai/Vobiz-Sprag-Pipecat](https://github.com/vobiz-ai/Vobiz-Sprag-Pipecat), the complete agent with setup instructions and a call simulator for testing without a phone.

## How it works

![A caller phones a Vobiz number. Vobiz streams the call audio over a WebSocket to a Pipecat pipeline, where Sprag Rhythm transcribes it, Symphony writes the reply and Chorus speaks it back to the caller.](https://mintcdn.com/vobizai/BIhGQiEFOayAAbQr/images/sprag/how-it-works-light.svg?fit=max\&auto=format\&n=BIhGQiEFOayAAbQr\&q=85\&s=0395313d617ff4b9ca37fe02844e177c)

**1. Someone calls your Vobiz number**

Vobiz answers and asks your agent what to do. The agent replies with [Stream XML](https://www.vobiz.ai/docs/xml/stream/initiate.md), and Vobiz starts streaming the call's audio to it over a WebSocket.

**2. Rhythm hears the caller**

Sprag's speech-to-text model turns the caller's words into text as they speak. Pipecat detects when they've finished their turn.

**3. Symphony writes the reply**

Sprag's own model reads the conversation so far and writes what the agent says next.

**4. Chorus speaks it on the call**

Sprag's text-to-speech model turns the reply into a natural voice. Vobiz plays it to the caller, and the conversation continues.

## Who does what

| | Vobiz | Sprag |
| - | - | - |
| **Role** | The phone line | The voice agent's brain and voice |
| **Provides** | Phone numbers, inbound and outbound calls, and the call's audio stream | Rhythm (speech-to-text), Symphony (Sprag's own model) and Chorus (text-to-speech) |
| **Connects through** | [`pipecat-vobiz`](https://pypi.org/project/pipecat-vobiz/), which converts call audio for Pipecat | [`pipecat-sprag`](https://pypi.org/project/pipecat-sprag/), which runs Sprag's models in Pipecat |
| **Billing** | Calls, on your Vobiz account | Model usage, on your Sprag account |

Pipecat sits in the middle and runs the conversation. It hands audio from Vobiz to Sprag, and Sprag's spoken reply back to Vobiz.

## What you need

* A [Vobiz account](https://console.vobiz.ai) with a phone number, and your Auth ID and Auth Token.
* A Sprag API key, from [sprag.ai](https://sprag.ai/).
* Python 3.11 or later, and a public HTTPS URL for the agent (a tunnel such as ngrok works while you build).

## Set it up

**1. Get the agent**

Clone [vobiz-ai/Vobiz-Sprag-Pipecat](https://github.com/vobiz-ai/Vobiz-Sprag-Pipecat) and follow its README to install it and add your Sprag and Vobiz keys.

**2. Try it without a phone**

Run the repository's call simulator. It plays the part of Vobiz, asks the agent a question, and saves the agent's spoken reply so you can listen to it.

**3. Give the agent a public URL**

Start the agent and expose it over HTTPS, for example with a tunnel. Note the URL.

**4. Point your Vobiz number at the agent**

[Create an application](https://www.vobiz.ai/docs/applications/create-application.md) with its **Answer URL** set to your agent's `/answer` address, then [attach your number](https://www.vobiz.ai/docs/applications/attach-number.md) to it.

**5. Call your number**

The agent greets you, and you can talk to it. To have the agent call someone instead, [make a call](https://www.vobiz.ai/docs/call/make-call.md) with the same Answer URL.

> [!WARNING]
>
> Calls are billed to your Vobiz account, and Sprag usage is billed to your Sprag account. Start with your own number.

## Audio quality

Vobiz streams calls as standard phone audio (μ-law at 8 kHz) or as wideband audio (L16 at 16 kHz); see [audio formats](https://www.vobiz.ai/docs/xml/stream/audio-formats.md). Chorus speaks at 24 kHz, and `pipecat-vobiz` converts its voice to the call's format, so the agent sounds clear on both.

## Make it yours

* **Personality and greeting:** change what the agent says in the repository's `bot.py`.
* **Voice:** pick another Chorus voice from Sprag's [voice presets](https://sprag.ai/docs/tts/voices/presets).
* **Turn-taking:** use Sprag's own turn detection, described in the [`pipecat-sprag` README](https://github.com/sprag-ai/pipecat-sprag).

## Related

> [card] [Example repository](https://github.com/vobiz-ai/Vobiz-Sprag-Pipecat)
>
> The complete agent and a call simulator

> [card] [Pipecat](https://www.vobiz.ai/docs/integrations/pipecat.md)
>
> Vobiz with Pipecat

> [card] [Sprag's Pipecat guide](https://sprag.ai/docs/integrations/pipecat)
>
> Sprag's own guide to `pipecat-sprag`

> [card] [Stream XML](https://www.vobiz.ai/docs/xml/stream/initiate.md)
>
> How Vobiz streams call audio


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.