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

# Generate Presentations via API in 5 minutes using Docker

> Steps to generate professional AI presentations via self hosted Presenton's API in just 5 minutes. 

In this guide, I'll walk you through a simple, straightforward way to host and use Presenton’s API for generating presentations. If you're a developer or someone building tools or automation around presentations, this approach will save you some valuable time.

Before we start, I'm assuming you've already set up Presenton. If not, just quickly check out the [Quickstart](../quickstart) or [Development guide](../development).

***

## Step 1: Ensure Docker is Installed

Presenton runs in Docker, making it easy to set up across different environments.

* Don't have Docker yet? Just grab it from [here](https://www.docker.com/get-started).

***

## Step 2: Run Presenton Locally with Docker

You're now ready to run Presenton's docker image to start generating presentations. First, you will have to decide upon the LLM provider you're going to use to generate presentations. You can go for either `OPENAI`, `GOOGLE`or `OLLAMA` . `GOOGLE` is free to start with but if you want complete control and privacy `OLLAMA` allows you to host your own model, but also requires `PEXELS`(free image library) API key.

We will go with `GOOGLE` in this guide as it's relatively simpler to configure and free to start with. You will have to grab its API Key from [Google AI Studio](https://aistudio.google.com/apikey).

You can find details to run with other providers in [Environment Variables](../configurations/environment-variables).

Now, open your command line and execute the relevant command based on your OS:

### Linux/macOS:

```bash theme={null}
docker run -it --name presenton -p 5000:80 -e LLM="google" -e GOOGLE_API_KEY="***" -e CAN_CHANGE_KEYS="false" -v "./user_data:/app/user_data" ghcr.io/presenton/presenton:latest
```

### Windows (PowerShell):

```powershell theme={null}
docker run -it --name presenton -p 5000:80 -e LLM="google" -e GOOGLE_API_KEY="***" -e CAN_CHANGE_KEYS="false" -v "${PWD}\user_data:/app/user_data" ghcr.io/presenton/presenton:latest
```

> If port `5000` is already occupied or you prefer a different port, feel free to change it.

Once this step is done, you can access Presenton locally at [http://localhost:5000](http://localhost:5000).

***

## Step 3: (Optional) Configure Environment Variables

Presenton supports several environment variables for customization (such as using OpenAI or local models).

Typical use-cases you might encounter:

* **External APIs**: [Using OpenAI or Gemini](./configurations/environment-variables).
* **GPU Acceleration**: [Using GPUs with Presenton](./configurations/using-gpu).
* **Local Models**: [Using Ollama and local models](./configurations/using-ollama-models).

If you don't need to change anything right now, it's safe to skip this step. Return to it when you need more customization.

***

## Step 4: Understanding the API Endpoint

Generating presentations via Presenton's API is straightforward. It has one primary endpoint:

```
POST /api/v1/ppt/presentation/generate
```

For a deeper dive later, check the full [API documentation](../index).

***

## Step 5: Making your first API Call

Here's how you'd quickly generate a presentation called "Introduction to Machine Learning":

<CodeGroup>
  ```bash bash theme={null}
  curl -X POST http://localhost:5000/api/v1/ppt/presentation/generate \
    -H "Content-Type: application/json" \
    -d '{
      "content": "Introduction to Machine Learning",
      "n_slides": 5,
      "language": "English",
      "template": "general",
      "export_as": "pptx"
    }'
  ```

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

  response = requests.post(
      "http://localhost:5000/api/v1/ppt/presentation/generate",
      json={
          "content": "Introduction to Machine Learning",
          "n_slides": 5,
          "language": "English",
          "template": "general",
          "export_as": "pptx"
      }
  )
  print(response.json())
  ```

  ```javascript javascript theme={null}
  fetch("http://localhost:5000/api/v1/ppt/presentation/generate", {
      method: "POST",
      headers: {
          "Content-Type": "application/json"
      },
      body: JSON.stringify({
          content: "Introduction to Machine Learning",
          n_slides: 5,
          language: "English",
          template: "general",
          export_as: "pptx"
      })
  })
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error("Error:", err));
  ```
</CodeGroup>

***

## Step 6: API Response in Practice

Here's what a normal, successful response looks like:

```json theme={null}
{
  "presentation_id": "d3000f96-096c-4768-b67b-e99aed029b57",
  "path": "/static/user_data/d3000f96-096c-4768-b67b-e99aed029b57/Introduction_to_Machine_Learning.pptx",
  "edit_path": "/presentation?id=d3000f96-096c-4768-b67b-e99aed029b57"
}
```

* **`presentation_id`**: Keep this handy if you want to refer back later.
* **`path`**: This is your generated PPT file. Download from here.
* `edit_path`: A convenient URL that lets you edit your slides directly from Presenton’s built-in editor.

> Note: Make sure to prepend your server's root URL to the path and edit\_path fields in the response to construct valid links.

***

## Step 7: Built-in Presentation Layouts

Presenton provides several built-in layouts to help you style your presentations quickly and professionally. Choose the one that best fits your audience and content:

* **classic**\
  A timeless, clean layout ideal for formal or academic presentations.
* **general**\
  A versatile, balanced layout suitable for most business or educational use cases.
* **modern**\
  A fresh, visually engaging layout with contemporary design elements—great for startups or creative topics.
* **professional**\
  A polished, corporate-style layout designed for executive meetings, pitches, and high-stakes presentations.

> 💡 **Did you know?**\
> Now you can create your own custom layouts too!\
> Check out the guide: [Create Custom Presentation Layouts](../walkthroughs/create-custom-presentation-layouts)

***

## Step 8 (Optional): Advanced Customization

Once you're comfortable and ready for more:

* Integrate your preferred LLMS: [Environment Variables](../configurations/environment-variables).
* Leverage GPU performance: [GPU Guide](../configurations/using-gpu).
* Run local AI models with Ollama: [Local Models](../configurations/using-ollama-models).

***

**That's it!** You've successfully generated a professional-looking presentation through an easy-to-use API endpoint.

To edit created presentation you can follow  [Edit Custom Presentation Using API](edit-custom-presentation-using-api).

If you have more questions or want to explore further, the [complete documentation](../index) is always here to help you.
