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

# Stream Audio

> Stream the audio recording of a call

## Stream Audio

Stream the audio recording of a call. Returns a binary audio file (`audio/ogg` or `audio/mpeg`).

## Parameters

**call\_id** `string` *required*

The unique call ID (e.g., `outbound-1776774443-863aa698`)

## Request Example

```bash cURL theme={null}
# CALL_ID=your_call_id
# API_KEY=your_api_key

# Download the audio file
curl -H "X-API-Key:$API_KEY" "https://api.vaanivoice.ai/api/stream/$CALL_ID" -o recording.ogg

# Check headers only (no download)
curl -sI -H "X-API-Key:$API_KEY" "https://api.vaanivoice.ai/api/stream/$CALL_ID"
```

```javascript JavaScript theme={null}
const CALL_ID = "outbound-1776774443-863aa698";
const API_KEY = "your_api_key";

const response = await fetch(
  `https://api.vaanivoice.ai/api/stream/${CALL_ID}`,
  {
    method: "GET",
    headers: {
      "X-API-Key": API_KEY,
    },
  }
);

// Use as audio source
const blob = await response.blob();
const url = URL.createObjectURL(blob);
const audio = new Audio(url);
audio.play();
```

```python Python theme={null}
import requests

CALL_ID = "outbound-1776774443-863aa698"
API_KEY = "your_api_key"

headers = {
    "X-API-Key": API_KEY
}

response = requests.get(
    f"https://api.vaanivoice.ai/api/stream/{CALL_ID}",
    headers=headers,
    stream=True
)

with open("recording.ogg", "wb") as f:
    for chunk in response.iter_content(chunk_size=8192):
        f.write(chunk)
```

## Response

### Success Response (200)

Returns a binary audio stream. The response is **not JSON** - it is the raw audio file.

```bash Response Headers theme={null}
HTTP/1.1 200 OK
content-type: audio/ogg
content-length: 1083518
```

**Content-Type** `string`

Audio format - typically `audio/ogg` or `audio/mpeg`

**Content-Length** `integer`

Size of the audio file in bytes

> [!NOTE]
>
> The response is a binary audio stream, not JSON. Use the `-o` flag with curl to save it to a file, or use the URL directly in an HTML `<audio>` tag for playback.

### Not Found (404)

Returned when the recording has not been generated yet (e.g., call is still in progress or too short).

```json theme={null}
{
  "status_code": 404,
  "error": "Not Found",
  "message": "Audio file not found",
  "code": "NOT_FOUND"
}
```

### Validation Error (422)

```json theme={null}
{
  "detail": [
    {
      "loc": ["path", "call_id"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}
```


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