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

# Downloading a Presentation

The **SlidesGPT API** allows you to download a generated presentation as a PowerPoint (`.pptx`) file.

### Request Example

Send a `GET` request to:

```
https://api.slidesgpt.com/v1/presentations/{id}/download
```

#### Sample Code (JavaScript)

```js theme={null}
import fs from "fs";

async function downloadPresentation(id) {
  try {
    const response = await fetch(`${API_BASE_URL}/presentations/${id}/download`, {
      method: "GET",
      headers: { Authorization: `Bearer ${token}` },
    });
    const buffer = await response.arrayBuffer();
    fs.writeFileSync(`presentation-${id}.pptx`, Buffer.from(buffer));
  } catch (err) {
    console.error(err);
  }
}
```

This function fetches the `.pptx` file and saves it locally.

#### Sample Code (wget)

```sh theme={null}
wget --header="Authorization: Bearer YOUR_API_KEY" \
     -O presentation.pptx \
     "https://api.slidesgpt.com/v1/presentations/12345/download"
```

> **Note:** You must include your API key in the `Authorization` header. If you don’t have one, follow the steps in the [Authentication Guide](/getting-started/authentication) to get your API key.
