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

# Download Recording

> Download the audio file for a recording

Download the audio file for a recording. This endpoint streams the audio bytes directly.

## Path Parameters

<ParamField path="recording_id" type="string" required>
  The unique recording identifier (e.g., `rec_01HABC987654321`).
</ParamField>

## Response

Returns the audio file as a binary stream.

### Headers

| Header                | Description                |
| --------------------- | -------------------------- |
| `Content-Type`        | `audio/mpeg` for MP3 files |
| `Content-Length`      | File size in bytes         |
| `Content-Disposition` | Filename suggestion        |

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.kallglot.com/v1/recordings/rec_01HABC987654321/audio \
    -H "Authorization: Bearer sk_live_your_api_key" \
    -o recording.mp3
  ```

  ```javascript Node.js theme={null}
  import fs from 'fs';

  const response = await fetch('https://api.kallglot.com/v1/recordings/rec_01HABC987654321/audio', {
    headers: {
      'Authorization': 'Bearer sk_live_your_api_key'
    }
  });
  const buffer = await response.arrayBuffer();
  fs.writeFileSync('recording.mp3', Buffer.from(buffer));
  ```

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

  response = requests.get(
      'https://api.kallglot.com/v1/recordings/rec_01HABC987654321/audio',
      headers={'Authorization': 'Bearer sk_live_your_api_key'}
  )
  response.raise_for_status()

  with open('recording.mp3', 'wb') as f:
      f.write(response.content)
  ```
</RequestExample>

<ResponseExample>
  ```text 200 OK theme={null}
  HTTP/1.1 200 OK
  Content-Type: audio/mpeg
  Content-Length: 1048576
  Content-Disposition: attachment; filename="recording-sess_01HXYZ123456789.mp3"

  [binary audio data]
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "recording_not_found",
      "message": "No recording found with ID 'rec_01HABC987654321'.",
      "type": "not_found_error"
    }
  }
  ```
</ResponseExample>

## Streaming Downloads

For large recordings, you can stream the download instead of buffering the entire file:

```javascript theme={null}
import { createWriteStream } from 'fs';
import { pipeline } from 'stream/promises';

const response = await fetch('https://api.kallglot.com/v1/recordings/rec_01HABC987654321/audio', {
  headers: {
    'Authorization': 'Bearer sk_live_your_api_key'
  }
});

await pipeline(
  response.body,
  createWriteStream('recording.mp3')
);
```

```python theme={null}
import requests

with requests.get(
    'https://api.kallglot.com/v1/recordings/rec_01HABC987654321/audio',
    headers={'Authorization': 'Bearer sk_live_your_api_key'},
    stream=True
) as r:
    r.raise_for_status()
    with open('recording.mp3', 'wb') as f:
        for chunk in r.iter_content(chunk_size=8192):
            f.write(chunk)
```

## Notes

<Note>
  Recordings are returned in MP3 format. The original audio is 8kHz mono (telephony quality).
</Note>
