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

# Using Presenton API

> You can use Presenton’s API to generate presentations programmatically. This is great for integrating Presenton into your own apps or workflows.

### 🎯 Endpoint

```
POST /api/v3/presentation/generate
```

Use this endpoint to generate a presentation from text content or uploaded documents.

<Note>
  For detailed information about the request format, please see the [API Reference](/api-reference/v3-presentation/generate-presentation-sync-v3).
</Note>

### 🔐 Authentication

Before calling the API, log in to Presenton and create an API key from your account page: [Presenton Account](https://presenton.ai/api-key). Your key will look like `sk-presenton-xxxxx`.

Include this key in every request using the Authorization header:

```http theme={null}
Authorization: Bearer sk-presenton-xxxxx
```

### 📤 Example Request

<CodeGroup>
  ```bash bash theme={null}
  curl -X POST https://api.presenton.ai/api/v3/presentation/generate \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-presenton-xxxxx" \
    -d '{
      "content": "Introduction to Machine Learning",
      "n_slides": 5,
      "language": "English",
      "standard_template": "general",
      "export_as": "pptx"
    }'
  ```

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

  url = "https://api.presenton.ai/api/v3/presentation/generate"
  data = {
      "content": "Introduction to Machine Learning",
      "n_slides": 5,
      "language": "English",
      "standard_template": "modern",
      "export_as": "pptx"
  }
  headers = {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk-presenton-xxxxx"
  }
  response = requests.post(url, json=data, headers=headers)
  print(response.json())
  ```

  ```javascript javascript theme={null}
  const data = {
    content: "Introduction to Machine Learning",
    n_slides: 5,
    language: "English",
    standard_template: "swift",
    export_as: "pptx"
  };

  fetch("https://api.presenton.ai/api/v3/presentation/generate", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk-presenton-xxxxx"
    },
    body: JSON.stringify(data)
  })
    .then(response => response.json())
    .then(data => {
      console.log(data);
    })
    .catch(error => {
      console.error("Error:", error);
    });
  ```
</CodeGroup>

### 📥 Example Response

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

* presentation\_id: Unique ID of the presentation
* path: File path for downloading the presentation
* edit\_path: Link to open the presentation in the editor
* credits\_consumed: Number of credits consumed for the presentation

## Editing the Presentation Manually

`edit_path` is the link to the User Interface to edit the presentation.

This link leads to the Presenton user interface that allows editing and re-exporting presentation to either PPTX of PDF.

Presentation can be edited in these ways:

* **edit text** in slides through intutive visual editor
* **change image** in slides by re-generating/fetching new images
* **change icons** in slides by searching for new icons and selecting one
* **change position of slides** in by dragging and rearranging slides
* **delete and add slides** manually
* **edit content (text, icons and images) through AI** using prompt (consumes AI credits)

<RequestExample>
  ```bash bash theme={null}
  curl -X POST https://api.presenton.ai/api/v3/presentation/generate \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-presenton-xxxxx" \
    -d '{
      "content": "Introduction to Machine Learning",
      "n_slides": 5,
      "language": "English",
      "standard_template": "general",
      "export_as": "pptx"
    }'
  ```

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

  url = "https://api.presenton.ai/api/v3/presentation/generate"
  data = {
      "content": "Introduction to Machine Learning",
      "n_slides": 5,
      "language": "English",
      "standard_template": "modern",
      "export_as": "pptx"
  }
  headers = {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk-presenton-xxxxx"
  }
  response = requests.post(url, json=data, headers=headers)
  print(response.json())
  ```

  ```javascript javascript theme={null}
  const data = {
    content: "Introduction to Machine Learning",
    n_slides: 5,
    language: "English",
    standard_template: "swift",
    export_as: "pptx"
  };

  fetch("https://api.presenton.ai/api/v3/presentation/generate", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk-presenton-xxxxx"
    },
    body: JSON.stringify(data)
  })
    .then(response => response.json())
    .then(data => {
      console.log(data);
    })
    .catch(error => {
      console.error("Error:", error);
    });
  ```
</RequestExample>

<ResponseExample>
  ```json json theme={null}
  {
    "presentation_id": "d3000f96-096c-4768-b67b-e99aed029b57",
    "path": "https://api.presenton.ai/static/user_data/d3000f96-096c-4768-b67b-e99aed029b57/Introduction_to_Machine_Learning.pptx",
    "edit_path": "https://presenton.ai/presentation?id=d3000f96-096c-4768-b67b-e99aed029b57",
    "credits_consumed": 5
  }
  ```
</ResponseExample>
