> ## 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.

# Pipecat + Vobiz SIP Trunking | AI Voice Pipelines

> Pipecat connects to Vobiz SIP trunking to power AI voice pipelines on real phone calls - WebSocket streaming and SIP trunk setup across 130+ countries.

This integration combines Vobiz telephony with the [Pipecat](https://pipecat.ai) voice agent framework to build intelligent AI-powered phone calls.

[Pipecat + Vobiz Integration Tutorial](https://www.youtube.com/embed/4ae-Lgg2gbU)

## Overview

**What you'll build:** An outbound calling system with real-time AI conversations powered by OpenAI (STT → LLM → TTS), automatic call recording, and bidirectional audio streaming.

Three moving parts do all the work:

| Part | What it is | Responsibility |
| - | - | - |
| `server.py` | Your FastAPI app | Places the call, serves the answer XML, accepts the WebSocket |
| `bot.py` | The Pipecat pipeline | Runs STT → LLM → TTS for the duration of one call |
| `pipecat-vobiz` | `VobizFrameSerializer` | Translates between Vobiz's JSON/base64 WebSocket protocol and Pipecat audio frames |

### Call flow

Actors
You
server.py
Vobiz
bot.py
Customer

Phase 1 · Placing the call

1

You
→
server.py

Trigger the call.

<pre>
  `POST /start   { "phone_number": "+91…" }`
</pre>

2

server.py
→
Vobiz

Server calls the Vobiz Call API, filling `answer_url` from `PUBLIC_URL`.

<pre>
  `POST /api/v1/Account/{AUTH_ID}/Call/             { from, to, answer_url, answer_method }`
</pre>

3

Vobiz
→
server.py

Call accepted.

<pre>
  `201 Created   { "request_uuid": "…" }`
</pre>

Phase 2 · Answer & instructions

4

Vobiz
→
Customer

Vobiz dials out over PSTN — the phone rings, then the customer answers.

5

Vobiz
→
server.py

On answer, Vobiz asks your server what to do.

<pre>
  `POST {PUBLIC_URL}/answer`
</pre>

6

server.py
→
Vobiz

Returns VobizXML: record the session, and stream the caller’s audio to your bot.

<pre>
  `200 application/xml              <Record … />             <Stream bidirectional="true" audioTrack="inbound"
                    contentType="audio/x-mulaw;rate=8000"
                    keepCallAlive="true">wss://…/ws</Stream>`
</pre>

Phase 3 · The live conversation

7

Vobiz
→
bot.py

WebSocket upgrade on `/ws`, then a single `start` event carrying the IDs and the negotiated audio format.

<pre>
  `{ "event": "start",
              "start": { "callId": "…", "streamId": "…",
                         "mediaFormat": { "encoding": "audio/x-mulaw",
                                          "sampleRate": 8000 } } }`
</pre>

`parse_vobiz_start()` reads this before the transport is built. **mediaFormat is authoritative** — prefer it over your own `contentType`.

8

Vobiz
↔
bot.py
bidirectional · \~20 ms frames

Audio flows both ways as base64 `media` events.

<pre>
  `{ "event": "media", "media": { "payload": "<base64 μ-law>" } }`
</pre>

VobizFrameSerializer
→
Silero VAD
→
OpenAI STT
→
GPT
→
OpenAI TTS
→
back to Vobiz

Phase 4 · Teardown & recording

9

Customer
hangs up →
Vobiz
→
bot.py

<pre>
  `{ "event": "stop" }`
</pre>

With `auto_hang_up=True` the serializer also issues a REST hangup, so a bot-initiated end tears the call down cleanly.

10

Vobiz
→
server.py

Recording callback fires; the helper downloads the file.

<pre>
  `POST /recording-ready   { "RecordUrl": "…", … }
              → download_recording.py  →  recordings/<recording_id>.mp3`
</pre>

> [!NOTE]
>
> Steps 1–3 are only for **outbound** calls. For inbound calls the flow starts at step 6 — Vobiz calls your `/answer` URL directly. See [Receiving inbound calls](#receiving-inbound-calls).

## Features

> [card] AI Voice Conversations
>
> Natural conversations powered by OpenAI GPT + TTS/STT

> [card] Outbound Calling
>
> Trigger calls via REST API from anywhere

> [card] Automatic Recording
>
> All conversations automatically recorded and saved

> [card] Real-time Streaming
>
> Bidirectional audio via WebSockets

## Prerequisites

**Vobiz Account** with Auth ID and Auth Token → [Sign up](https://console.vobiz.ai/auth/signup)

**OpenAI API Key** for LLM, STT, and TTS → [Get API key](https://platform.openai.com/api-keys)

**Python 3.11+** installed on your system

**ngrok** for local development → [Download ngrok](https://ngrok.com/download)

> [!WARNING]
>
> **Python 3.11 is a hard floor.** `pipecat-ai` 1.x declares `requires-python >=3.11`. On Python 3.10, `pip` does not fail — it silently backtracks and installs an ancient `0.0.x` Pipecat, and then every import in `bot.py` breaks with confusing `ModuleNotFoundError`s. Check with `python --version` before installing.

### Version compatibility

This integration targets the **Pipecat 1.x** API. Versions are pinned in `requirements.txt`:

| Package | Pin | Why |
| - | - | - |
| `pipecat-ai[websocket,openai,silero]` | `>=1.8.1,<1.9` | Pipecat 1.x moved VAD onto `LLMUserAggregatorParams` and introduced `LLMContext`. The 1.8 line is the recommended one. |
| `pipecat-vobiz` | `>=0.0.3,<0.1` | 0.0.3 adds L16, multi-rate, `start`-event negotiation and `stop`-event hangup. |
| Python | `>=3.11` | Required by `pipecat-ai` 1.x. |

> [!NOTE]
>
> Pipecat 1.9 and 1.10 are published but are **not** covered by this pin. Widen the upper bound only after re-testing — the serializer contract has changed once already inside 1.x (`FrameSerializer.setup()` took a `StartFrame` before 1.3 and a `FrameProcessorSetup` after).

> [!NOTE]
>
> Pipecat 1.x deprecated `pipecat.pipeline.task` in favour of `pipecat.pipeline.worker` (`PipelineTask` → `PipelineWorker`). The old import path still works for all of 1.x and is what this repo uses, but it is scheduled for removal in Pipecat 2.0 — which is why the pin is `<2`.

## Installation

**1. Clone the repository**

```bash theme={null}
git clone https://github.com/vobiz-ai/Vobiz-X-Pipecat
cd Vobiz-X-Pipecat
```

**2. Install dependencies**

```bash theme={null}
pip install -r requirements.txt
```

> [!NOTE]
>
> This installs FastAPI, Pipecat, OpenAI SDK, and other required packages.

**3. Configure environment**

The repo ships an `env.example` file. Copy it and fill in your values:

```bash theme={null}
cp env.example .env
```

```bash .env theme={null}
# --- Required ---
OPENAI_API_KEY=sk-...
VOBIZ_AUTH_ID=MA_XXXXXXXX
VOBIZ_AUTH_TOKEN=your-token-here
PUBLIC_URL=https://your-ngrok-url.ngrok-free.app

# --- Caller ID for outbound ---
VOBIZ_PHONE_NUMBER=+918065480214

# --- Wire format (must match the <Stream contentType> server.py emits) ---
VOBIZ_ENCODING=audio/x-mulaw
VOBIZ_SAMPLE_RATE=8000
VOBIZ_L16_ENDIAN=le
```

**Required**

| Variable | Where to find it |
| - | - |
| `OPENAI_API_KEY` | OpenAI Platform → API Keys |
| `VOBIZ_AUTH_ID` | Vobiz Console → Account Settings |
| `VOBIZ_AUTH_TOKEN` | Vobiz Console → Account Settings |
| `PUBLIC_URL` | Your ngrok HTTPS URL (set in Step 2 of Usage) |

**Optional**

| Variable | Default | Purpose |
| - | - | - |
| `VOBIZ_PHONE_NUMBER` | — | Caller ID for `/start`. Required unless you pass `from_number` in the request body. |
| `VOBIZ_ENCODING` | `audio/x-mulaw` | Wire encoding. `audio/x-mulaw` or `audio/x-l16`. |
| `VOBIZ_SAMPLE_RATE` | `8000` | Wire sample rate. `8000` or `16000`. |
| `VOBIZ_L16_ENDIAN` | `le` | L16 byte order. Ignored for μ-law. See the note below. |
| `ENABLE_RECORDING` | `true` | Set `false` to omit the `<Record>` element from the answer XML. |
| `MAX_RECORDING_LENGTH` | `3600` | Recording cap in seconds. |
| `ENV` | `local` | `local` or `production`. |
| `VOBIZ_PROD_WS_URL` | — | Required when `ENV=production` — the public `wss://` URL hosting your bot. |
| `TRANSFER_AGENT_NUMBER` | — | Required only if you use the human-transfer endpoints. |
| `AGENT_NAME` / `ORGANIZATION_NAME` | — | Used to build the `serviceHost` query param when `ENV=production`. |
| `DEEPGRAM_API_KEY` | — | Not read by `bot.py` as shipped. Set it only if you swap `OpenAISTTService` for `DeepgramSTTService`. |

> [!WARNING]
>
> **`VOBIZ_L16_ENDIAN` only matters for `audio/x-l16`.** RFC 2586 specifies big-endian (network byte order), but some Vobiz accounts transport L16 as **little-endian**. If L16 media frames arrive at the expected size yet STT returns no transcripts, flip this to `le`. Leave the default μ-law encoding and you never hit this.

## Usage

**1. Start the server**

```bash theme={null}
python server.py
```

The server runs on `http://0.0.0.0:7860`.

**2. Start ngrok**

In a new terminal, expose your local server:

```bash theme={null}
ngrok http 7860
```

Copy the ngrok URL from the output (for example, `https://abc123.ngrok-free.app`).

> [!WARNING]
>
> **Important:** Update `PUBLIC_URL` in your `.env` file with this ngrok URL, then restart the server.

**3. Make a call**

There are two ways to trigger an outbound call - pick whichever fits your stack.

> [tab] Server's /start helper (easiest)
>
> The repo exposes `POST /start` on the local server. It wraps the Vobiz Call API and auto-fills `answer_url` from your `PUBLIC_URL`, plus uses `VOBIZ_PHONE_NUMBER` as `from` when set.
>
> ```bash theme={null}
> curl -X POST http://localhost:7860/start \
>   -H "Content-Type: application/json" \
>   -d '{ "phone_number": "+919148223344" }'
> ```
>
> > [!WARNING]
> >
> > The field is **`phone_number`**, not `to`. `server.py` returns `400 Missing 'phone_number' in the request body` for anything else.
>
> | Field | Required | Purpose |
> | - | - | - |
> | `phone_number` | Yes | The number to dial. |
> | `from_number` | No | Caller ID. Falls back to `VOBIZ_PHONE_NUMBER`; if neither is set the call is rejected with `400`. |
> | `body` | No | Arbitrary JSON. Forwarded to `/answer` as a URL-encoded query param, then base64-encoded onto the WebSocket URL so `bot.py` can read per-call context. |
>
> Response:
>
> ```json theme={null}
> { "call_uuid": "…", "status": "call_initiated", "phone_number": "+919148223344" }
> ```

> [tab] Direct Vobiz API
>
> ```bash theme={null}
> curl -X POST https://api.vobiz.ai/api/v1/Account/YOUR_AUTH_ID/Call/ \
>   -H "X-Auth-ID: YOUR_AUTH_ID" \
>   -H "X-Auth-Token: YOUR_AUTH_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "from": "+918011223344",
>     "to": "+919148223344",
>     "answer_url": "https://your-ngrok-url.ngrok-free.app/answer",
>     "answer_method": "POST"
>   }'
> ```

**What happens next:**

* Phone rings at the `phone_number` you passed
* When answered, Vobiz requests XML from your server's `/answer` endpoint
* Server returns `<Record>` + `<Stream>` pointing at `wss://…/ws`
* Vobiz opens the WebSocket and sends a `start` event, then `media` frames
* AI assistant speaks and listens (STT → LLM → TTS)
* On hangup, Vobiz posts the recording URL to `/recording-ready`, which downloads it to `recordings/`

## How the flow works

Everything above is driven by one XML document and one WebSocket protocol. This section is what you need if you are adapting the repo rather than running it as-is.

### The answer XML

`/answer` returns this (with `{PUBLIC_URL}` and the wire format substituted in):

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Record fileFormat="wav" maxLength="3600" recordSession="true"
            callbackUrl="https://your-ngrok-url.ngrok-free.app/recording-ready"
            callbackMethod="POST">
    </Record>
    <Stream bidirectional="true" audioTrack="inbound"
            contentType="audio/x-mulaw;rate=8000" keepCallAlive="true">
        wss://your-ngrok-url.ngrok-free.app/ws
    </Stream>
</Response>
```

Why each attribute matters:

| Attribute | Value | Why |
| - | - | - |
| `bidirectional` | `true` | Lets the bot play TTS audio back to the caller. Without it the stream is listen-only. |
| `audioTrack` | `inbound` | The caller's audio. **Must** be `inbound` when `bidirectional="true"`. |
| `contentType` | `audio/x-mulaw;rate=8000` | Must match what `VobizFrameSerializer` is constructed with. |
| `keepCallAlive` | `true` | Keeps the call up when the stream ends, so `<Record>` can finish and callbacks fire. |

> [!WARNING]
>
> **`audioTrack="both"` is incompatible with `bidirectional="true"`.** The media server accepts the XML, sends a `start` event, and then never sends audio — a silent failure that looks like a broken bot. Use `audioTrack="inbound"` for any bidirectional stream. To capture both legs, use two separate one-way `<Stream>` elements.

### The WebSocket protocol

Vobiz speaks JSON text frames. `VobizFrameSerializer` handles all of this for you; the shapes are here so you can debug what you see on the wire.

> [accordion] start — sent once, immediately after the upgrade
>
> ```json theme={null}
> {
>   "event": "start",
>   "start": {
>     "callId": "…",
>     "streamId": "…",
>     "mediaFormat": { "encoding": "audio/x-mulaw", "sampleRate": 8000 }
>   }
> }
> ```
>
> `bot.py` reads this with `parse_vobiz_start()` before building the transport, because it carries both the IDs needed for REST hangup and the negotiated audio format.
>
> > [!NOTE]
> >
> > **`mediaFormat` is authoritative.** It reflects what the media server actually negotiated. If it differs from the `contentType` you asked for in your `<Stream>` XML, trust this event — the XML is a request, the `start` event is the agreement. The serializer adopts these values automatically and logs a warning on mismatch.

> [accordion] media — the audio frames, both directions
>
> ```json theme={null}
> { "event": "media", "media": { "payload": "<base64-encoded audio>" } }
> ```
>
> At 8 kHz μ-law this arrives roughly every 20 ms as 160-byte payloads. The serializer base64-decodes, converts μ-law → linear PCM, and resamples to the pipeline rate; outbound TTS makes the same trip in reverse.

> [accordion] stop — the call is over
>
> ```json theme={null}
> { "event": "stop" }
> ```
>
> With `auto_hang_up=True` the serializer also issues a REST hangup using `call_id` + your auth credentials, so a bot-initiated end tears the call down properly rather than leaving it hanging.

### Sample rates

| Rate | μ-law | L16 | Notes |
| - | - | - | - |
| 8000 | Supported | Supported | Default. Matches the PSTN carrier path — no transcode. |
| 16000 | Supported | Supported | Vobiz transcodes. |
| 24000 | Not reliable | Not reliable | Appears in the protocol, but the media server may accept the XML and then **silently never open the WebSocket**. Avoid. |

### The Pipecat pipeline

`bot.py` builds a standard cascaded pipeline. Two details are specific to Pipecat 1.x and telephony:

```python bot.py theme={null}
context_aggregator = LLMContextAggregatorPair(
    context,
    # Pipecat 1.x: VAD is wired HERE, not on the transport.
    user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)

transport = FastAPIWebsocketTransport(
    websocket=runner_args.websocket,
    params=FastAPIWebsocketParams(
        audio_in_enabled=True,
        audio_out_enabled=True,
        add_wav_header=False,   # CRITICAL for telephony
        serializer=serializer,
    ),
)
```

> [!WARNING]
>
> **Two mistakes that produce a silent bot:**
>
> * Passing `vad_analyzer=` to `FastAPIWebsocketParams`. In Pipecat 1.x the transport no longer has that field, and Pydantic **silently discards it** — you get no error and no turn detection. It belongs on `LLMUserAggregatorParams`.
> * Leaving `add_wav_header` at its default. A WAV header prepended to every frame is interpreted as audio by the media server, and the caller hears noise.

Pipeline order matters — `transport.output()` sits before `context_aggregator.assistant()` so what the bot actually said is what gets recorded into context:

```python theme={null}
pipeline = Pipeline([
    transport.input(),          # Vobiz → frames
    stt,                        # Speech-to-text
    context_aggregator.user(),
    llm,                        # LLM
    tts,                        # Text-to-speech
    transport.output(),         # frames → Vobiz
    context_aggregator.assistant(),
])
```

## Receiving inbound calls

Configure your Vobiz number to handle incoming calls with your Pipecat agent.

**1. Open Applications**

Log in to the Vobiz Console and navigate to the **Applications** section in the sidebar.

![Open Applications](https://mintcdn.com/vobizai/OZ7y9Kg025aXyvCH/images/pipecat/image1.png?fit=max\&auto=format\&n=OZ7y9Kg025aXyvCH\&q=85\&s=bebde1c06f39cbd1c4897de25e604f84)

**2. Create an application**

Click **Create New Application** and give it a name (for example, "Pipecat Agent").

![Create an application](https://mintcdn.com/vobizai/OZ7y9Kg025aXyvCH/images/pipecat/image2.png?fit=max\&auto=format\&n=OZ7y9Kg025aXyvCH\&q=85\&s=09e88aae040f0fda432ac1d5acb60c67)

**3. Configure URLs**

Set the **Answer URL** to your ngrok URL (for example, `https://.../answer`) and select `POST` method. You can use the same URL for Hangup or leave it blank.

![Configure the Answer URL](https://mintcdn.com/vobizai/OZ7y9Kg025aXyvCH/images/pipecat/image3.png?fit=max\&auto=format\&n=OZ7y9Kg025aXyvCH\&q=85\&s=b9079fffd97a49493326df0835d25ac5)

**4. Assign phone number**

Go to **Phone Numbers**, select your number, and assign it to the application you just created.

![Attach your phone number](https://mintcdn.com/vobizai/OZ7y9Kg025aXyvCH/images/pipecat/image4.png?fit=max\&auto=format\&n=OZ7y9Kg025aXyvCH\&q=85\&s=0a9dcd9879635f8752398ee00bc5da1f)

> [!TIP]
>
> **Success:** Calls to your Vobiz number will now be handled by your local Pipecat server!

## Quick reference

### Server endpoints

| Endpoint | Method | Description |
| - | - | - |
| `/start` | POST | Trigger an outbound call. Body: `{ "phone_number": "+91..." }`. Wraps the Vobiz Call API. |
| `/answer` | GET, POST | Called by Vobiz when the call is answered. Returns `<Record>` + `<Stream>` XML pointing at `/ws`. |
| `/ws` | WebSocket | Bidirectional audio between Vobiz and the Pipecat bot. Also served at `/`, `/voice/ws` and `/stream` for flexibility in what you put in the XML. |
| `/recording-finished` | GET, POST | Vobiz callback when recording stops. Logs metadata. |
| `/recording-ready` | GET, POST | Vobiz callback when the recording is ready. Downloads the file via `download_recording.py`. |
| `/active-calls` | GET | Debug view of the in-memory call registry. |
| `/initiate-transfer` | POST | Flags a call for human transfer, then calls the Vobiz Transfer API. |
| `/transfer-to-human` | POST | Returns the `<Speak>` + `<Dial>` XML used by the transfer flow. |

> [!NOTE]
>
> The call registry is an in-memory dict. It resets on restart and does not work across multiple workers — use Redis or a database before running more than one process in production.

### Project files

| File | Purpose |
| - | - |
| `server.py` | FastAPI app - owns `/start`, `/answer`, `/ws`, and the recording callbacks |
| `bot.py` | Pipecat pipeline - STT → LLM → TTS, runs per call |
| `download_recording.py` | Helper used by `/recording-ready` to pull the recording from Vobiz |
| `requirements.txt` | Python dependencies, with the Pipecat version pins |
| `env.example` | Template for your `.env` file - copy and fill in |

> [!NOTE]
>
> `VobizFrameSerializer` and `parse_vobiz_start` are **not** in this repo — they ship in the separate [`pipecat-vobiz`](https://pypi.org/project/pipecat-vobiz/) package, which installs into the `pipecat.serializers` namespace. That is why `bot.py` imports them from `pipecat.serializers.vobiz` rather than from a local file.

## Customizing the bot

Edit `bot.py` to customize your AI assistant:

```python Change Bot Personality theme={null}
messages = [
    {
        "role": "system",
        "content": "You are a friendly customer service agent..."
    },
]
```

```python Change TTS Voice theme={null}
tts = OpenAITTSService(
    api_key=os.getenv("OPENAI_API_KEY"),
    voice="ballad",  # alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer
)
```

> [!TIP]
>
> The bot as shipped **waits for the caller to speak first** — `on_client_connected` only logs. To have it greet the caller, queue an `LLMRunFrame` in that handler so the LLM produces its opening line from the system prompt.

## Troubleshooting

> [accordion] Import errors right after pip install
>
> Almost always Python 3.10. `pipecat-ai` 1.x requires **3.11+**, and on 3.10 pip installs a `0.0.x` release instead of failing. Run `python --version`, then `pip show pipecat-ai` — if the version starts with `0.0.`, recreate your virtualenv on 3.11+.

> [accordion] The bot never replies — it hears nothing
>
> Check VAD wiring. In Pipecat 1.x, `vad_analyzer` belongs on `LLMUserAggregatorParams`, **not** on `FastAPIWebsocketParams`. The transport no longer has that field, and Pydantic discards unknown fields silently, so the mistake produces no error at all — just a bot that never detects the end of a turn.

> [accordion] The caller hears static or noise instead of speech
>
> Set `add_wav_header=False` on `FastAPIWebsocketParams`. A WAV header on every frame is played as audio by the media server.

> [accordion] start event arrives, then no media frames
>
> Check for `audioTrack="both"` with `bidirectional="true"`. Bidirectional streams use `audioTrack="inbound"`, so set that to start receiving media frames.

> [accordion] Media frames arrive but STT produces nothing (L16 only)
>
> Byte order. Set `VOBIZ_L16_ENDIAN=le`. The docs and RFC 2586 specify big-endian, but some accounts transport L16 little-endian. Using the default `audio/x-mulaw` avoids the problem entirely.

> [accordion] The WebSocket never opens at all
>
> Two common causes: the sample rate is `24000` (not reliably supported — use 8000 or 16000), or `PUBLIC_URL` is stale. After restarting ngrok the URL changes; update `PUBLIC_URL` and restart the server, since the answer XML is built from it.

> [accordion] Vobiz cannot reach /answer
>
> If `PUBLIC_URL` is unset the server falls back to the request `Host` header, which is `localhost` in local runs — Vobiz cannot route to that. The server prints a warning when this happens. Set `PUBLIC_URL` to your public HTTPS URL.

> [accordion] The downloaded recording is named .mp3 but will not play as one
>
> Known quirk. The answer XML requests `fileFormat="wav"`, so Vobiz serves a `.wav` URL — but `download_recording.py` unconditionally appends `.mp3` to the saved filename. The bytes are a RIFF/WAVE container (8 kHz, 16-bit, stereo); only the extension is wrong. Rename it to `.wav`, or change the `fileFormat` in the `<Record>` element to match the extension you want.

> [!TIP]
>
> **Integration complete!**
>
> You can now make AI-powered phone calls with Vobiz and Pipecat.

## Next steps

* Customize your AI assistant's personality in `bot.py`
* Deploy to production (AWS/GCP/Heroku) instead of ngrok
* Add custom business logic and integrations

## Resources

**Vobiz Documentation**

* [API Documentation](https://www.vobiz.ai/docs/account.md)
* [Make a Call](https://www.vobiz.ai/docs/call/make-call.md)
* [Vobiz Console](https://console.vobiz.ai)

**External Resources**

* [GitHub Repository](https://github.com/vobiz-ai/Vobiz-X-Pipecat)
* [Pipecat Documentation](https://docs.pipecat.ai)

## Build it with an AI agent

Clone, configure, and run the Vobiz-X-Pipecat repo - your first AI voice agent in \~5 minutes.

Using the Vobiz MCP at `https://www.vobiz.ai/docs/mcp`:

1. Read the `vobiz-ai-voice-agents` skill from `mintlify://skills/ai-voice-agents` and the `vobiz-audio-streams` skill from `mintlify://skills/audio-streams`.
2. Check my Python version first — `pipecat-ai` 1.x needs **3.11+**, and on 3.10 pip silently installs an incompatible `0.0.x` release. Stop and tell me if I'm on 3.10 or older.
3. Clone `https://github.com/vobiz-ai/Vobiz-X-Pipecat` into the current directory.
4. Run `pip install -r requirements.txt` (warn me first if I'm not in a virtualenv), then confirm `pip show pipecat-ai` reports a 1.8.x version.
5. Copy `env.example` to `.env` and ask me for: `OPENAI_API_KEY`, `VOBIZ_AUTH_ID`, `VOBIZ_AUTH_TOKEN`, my Vobiz number for `VOBIZ_PHONE_NUMBER`. Leave `PUBLIC_URL` and `DEEPGRAM_API_KEY` blank for now.
6. Explain how to start the FastAPI server (`python server.py`) and how to expose it with `ngrok http 7860`. Tell me to paste the ngrok HTTPS URL into `PUBLIC_URL` and restart — the answer XML is built from that value, so a stale URL breaks the call.
7. Show me the curl to fire my first AI-powered call via the local `/start` endpoint: `POST http://localhost:7860/start` with body `{"phone_number": "+91..."}` (the field is `phone_number`, not `to`).
8. Explain the call flow: Vobiz → `/answer` → returns `<Record>` + `<Stream>` XML → WebSocket upgrade on `/ws` → `start` event carrying the authoritative `mediaFormat` → base64 `media` frames both ways → Pipecat pipeline (STT → LLM → TTS) → recording delivered to `/recording-ready`.


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