# MagicSlides API Documentation

> Official API documentation for MagicSlides - Learn how to integrate AI-powered presentation generation into your applications.

Source: https://www.magicslides.app/docs-api
Format: Markdown via content negotiation (`Accept: text/markdown`). Site map for agents: https://www.magicslides.app/llms.txt · API: https://www.magicslides.app/openapi.json

---
MagicSlides API

# Generate presentations from any source

Turn a topic, text, PDF, YouTube video, website, or DOCX into a ready-to-present PowerPoint and PDF — with a single REST call. No slide-rendering code to maintain.

[Quick start →](https://www.magicslides.app/docs-api/quick-start)[Get your API key](https://www.magicslides.app/dashboard/settings/api)

### Global clean-energy capacity

Installed gigawatts, 2021–2025

42

58

70

85

96

’21’22’23’24’25

### Why the shift is accelerating

-   ✓Solar costs fell 89% in a decade
-   ✓Battery storage is now grid-viable
-   ✓Policy incentives in 60+ countries
-   ✓Corporate demand at record highs

Presentation

### The Future of Renewable Energy

Solar, wind & storage over the next decade

MagicSlides

Get started

## Your first deck in 3 steps

1

### Get your API key

Generate a key in your dashboard settings.

2

### POST your content

Send your apiKey plus a topic, text, or URL to one endpoint.

3

### Get your deck

The response returns a downloadable .pptx and .pdf.

### Make the call

Authenticate with your `apiKey` and POST your content.

POST /ppt-from-text

```
curl -X POST https://api.magicslides.app/public/api/ppt-from-text \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "ms-api-xxxxxxxx",
    "topic": "The future of renewable energy",
    "slideCount": 10,
    "language": "en",
    "aiImages": true,
    "model": "gpt-4"
  }'
```

### What you get back

```json
{
  "status": "success",
  "url": "https://.../presentation.pptx",
  "pdfUrl": "https://.../presentation.pdf",
  "pptId": "presentation-id"
}
```

Presentation

### The Future of Renewable Energy

Solar, wind & storage over the next decade

MagicSlides

Inputs

## Send any source

One unified endpoint auto-detects the input type.

Topic

`topic`

Text

`topic`

PDF

`pdfURL`

YouTube

`youtubeURL`

Website URL

`websiteURL`

DOCX

`docxURL`

Use cases

## What people build with it

### Embed in your product

Add one-click deck generation to your SaaS, LMS, or internal tools.

### Automate reports

Turn recurring data or summaries into branded decks on a schedule.

### Generate at scale

Produce one deck per client, dataset, or topic — in bulk.

### AI agents & MCP

Let Claude, Cursor, or any agent build slides as a tool call.

## Authentication

The API supports two authentication methods:

### API Key Authentication (Recommended)

Use an API key for authentication. Get your API key from your [dashboard settings](https://www.magicslides.app/dashboard/settings/api).

Include the `apiKey` field in your request body. Format: `ms-api-{base64-encoded-payload}.{secret}`

### Email and AccessId (Backward Compatibility)

For backward compatibility, you can use `email` and `accessId` instead of an API key. **API key authentication takes precedence.**

New

## CLI API — Editable, HTML Template & Studio

A newer, more powerful API family lives directly on **www.magicslides.app**. It uses an `x-api-key` request header (not a body field) and returns richer outputs — a live editor, raw per-slide HTML, or a real-time SSE stream built by Claude.

CLI API (this section)

`https://www.magicslides.app`

Auth via `x-api-key` header · Returns editor URLs, HTML, or SSE

Legacy API (below)

`https://api.magicslides.app`

Auth via `apiKey` body field · Returns PPTX + PDF download URLs

All CLI API endpoints require the header `x-api-key: YOUR_API_KEY`. Get your key from [dashboard → Settings → API](https://www.magicslides.app/dashboard/settings/api).

### 1\. Editable Presentations

$0.50 / deck

Generates a presentation and returns a URL to the MagicSlides editor where it can be tweaked, downloaded as PPTX, or exported to PDF.

Endpoint

`POST https://www.magicslides.app/api/cli/generate-presentation`

Parameters

`topic`stringrequiredPresentation topic or content

`slides`numberSlide count (1–20). Default 5.

`language`stringLanguage code. Default "en".

`presentationType`stringe.g. "business", "educational"

`presentationTone`stringe.g. "professional", "casual"

`presentationFor`stringTarget audience description

`includeImages`booleanAdd stock images. Default false.

`webSearch`booleanEnhance with live web search. Default false.

Response

```json
{
  "success": true,
  "presentationId": "abc123",
  "presentationUrl": "https://www.magicslides.app/editor/abc123",
  "slug": "abc123",
  "slideCount": 8
}
```

Code examples

cURL

```bash
curl -X POST https://www.magicslides.app/api/cli/generate-presentation \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "topic": "The Future of AI in Healthcare",
    "slides": 8,
    "language": "en",
    "presentationType": "business",
    "presentationTone": "professional"
  }'
```

JavaScript / Node.js (fetch)

```typescript
const res = await fetch(
  'https://www.magicslides.app/api/cli/generate-presentation',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': 'YOUR_API_KEY',
    },
    body: JSON.stringify({
      topic: 'The Future of AI in Healthcare',
      slides: 8,
      language: 'en',
      presentationType: 'business',
      presentationTone: 'professional',
    }),
  }
)
const data = await res.json()
console.log(data.presentationUrl)
```

Python

```python
import requests

data = requests.post(
    'https://www.magicslides.app/api/cli/generate-presentation',
    headers={'x-api-key': 'YOUR_API_KEY'},
    json={
        'topic': 'The Future of AI in Healthcare',
        'slides': 8,
        'language': 'en',
        'presentationType': 'business',
        'presentationTone': 'professional',
    }
).json()
print(data['presentationUrl'])
```

### 2\. HTML Template

$0.50 / deck

Pick from 30+ professional templates. Returns per-slide HTML you can embed or host, plus PPTX and PDF download links. Call the templates list endpoint first to discover valid keys.

Step 1 — List templates

`GET https://www.magicslides.app/api/cli/templates`

Add `?mode=proslides` to filter to HTML-output templates only.

Step 2 — Generate

`POST https://www.magicslides.app/api/cli/generate-html-template`

Parameters

`topic`stringrequiredPresentation topic

`templateKey`stringrequiredFrom GET /api/cli/templates

`slides`numberSlide count (3–20). Default 7.

`language`stringLanguage code. Default "en".

`presentationType`stringe.g. "business"

`presentationTone`stringe.g. "professional"

`presentationFor`stringTarget audience

Response

```json
{
  "success": true,
  "mode": "proslides",
  "templateKey": "editorial-magazine",
  "slideCount": 8,
  "presentUrl": "https://www.magicslides.app/s/{id}/index.html",
  "pptxUrl": "https://…/presentation.pptx",
  "pdfUrl":  "https://…/presentation.pdf",
  "slides": [
    { "index": 1, "html": "<!DOCTYPE html>..." },
    { "index": 2, "html": "<!DOCTYPE html>..." }
  ]
}
```

Code examples

cURL

```bash
# 1. List templates
curl https://www.magicslides.app/api/cli/templates \
  -H "x-api-key: YOUR_API_KEY"

# 2. Generate
curl -X POST https://www.magicslides.app/api/cli/generate-html-template \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "topic": "Sustainable Energy Trends 2025",
    "templateKey": "editorial-magazine",
    "slides": 8,
    "language": "en"
  }'
```

JavaScript / Node.js (fetch)

```typescript
const headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'YOUR_API_KEY',
}

// 1. List templates
const templates = await fetch(
  'https://www.magicslides.app/api/cli/templates',
  { headers }
).then(r => r.json())

// 2. Generate
const data = await fetch(
  'https://www.magicslides.app/api/cli/generate-html-template',
  {
    method: 'POST',
    headers,
    body: JSON.stringify({
      topic: 'Sustainable Energy Trends 2025',
      templateKey: 'editorial-magazine',
      slides: 8,
      language: 'en',
    }),
  }
).then(r => r.json())
console.log(data.presentUrl)
```

Python

```python
import requests

headers = {'x-api-key': 'YOUR_API_KEY'}

# 1. List templates
templates = requests.get(
    'https://www.magicslides.app/api/cli/templates',
    headers=headers
).json()

# 2. Generate
data = requests.post(
    'https://www.magicslides.app/api/cli/generate-html-template',
    headers=headers,
    json={
        'topic': 'Sustainable Energy Trends 2025',
        'templateKey': 'editorial-magazine',
        'slides': 8,
        'language': 'en',
    }
).json()
print(data['presentUrl'])
```

### 3\. HTML Studio (Streaming)

$1.00 / deckSSE stream

AI builds a fully custom, animated HTML presentation from scratch — no template needed. Returns a **Server-Sent Events (SSE)** stream. Keep the connection open for 2–5 minutes. The final `done` event carries every URL you need.

✨ New: pass a `model` field to choose the AI model. Default: `deepseek/deepseek-chat-v3-0324`. Call `GET /api/cli/models` to list all available models.

ℹ️ On credit exhaustion a `{"type":"error","code":402}` event is sent and the stream closes immediately.

Endpoint

`POST https://www.magicslides.app/api/cli/generate-html-studio`

Parameters

`topic`stringrequiredWhat the presentation should be about

`style`stringVisual style — e.g. "dark, minimal, data-heavy"

`slides`numberApproximate slide count (3–20). Default 8.

`language`stringLanguage code. Default "en".

`model`stringAI model ID. Default: deepseek/deepseek-chat-v3-0324. See GET /api/cli/models for all options.

SSE event stream

```bash
data: {"type":"started","jobId":"…","credits":2}

data: {"type":"progress","message":"Sandbox ready. Planning slides…"}

data: {"type":"thinking","message":"Claude is writing slide 3…"}

data: {"type":"preview-url","url":"https://sb-xyz.vercel.run"}

data: {
  "type":           "done",
  "previewUrl":     "https://sb-xyz.vercel.run",
  "shareUrl":       "https://www.magicslides.app/s/{id}/index.html",
  "chatUrl":        "https://www.magicslides.app/en/studio/{id}",
  "slideUrls":      ["…/slide1.html", "…/slide2.html"],
  "conversationId": "22f31f82-…"
}

# On credit exhaustion:
data: {"type":"error","code":402,"message":"Credits exhausted"}
```

Code examples

cURL (pipe output to see events live)

```bash
# 1. (Optional) List available models
curl https://www.magicslides.app/api/cli/models \
  -H "x-api-key: YOUR_API_KEY"

# 2. Generate — keep connection open 2–5 min
curl -X POST https://www.magicslides.app/api/cli/generate-html-studio \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --no-buffer \
  -d '{
    "topic": "Future of Remote Work",
    "style": "modern dark with data visualizations",
    "slides": 8,
    "language": "en",
    "model": "deepseek/deepseek-chat-v3-0324"
  }'
```

JavaScript / Node.js (fetch + ReadableStream)

```typescript
// 1. (Optional) List available models
const models = await fetch(
  'https://www.magicslides.app/api/cli/models',
  { headers: { 'x-api-key': 'YOUR_API_KEY' } }
).then(r => r.json())
console.log(models.default) // "deepseek/deepseek-chat-v3-0324"

// 2. Stream the generation
const res = await fetch(
  'https://www.magicslides.app/api/cli/generate-html-studio',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': 'YOUR_API_KEY',
    },
    body: JSON.stringify({
      topic: 'Future of Remote Work',
      style: 'modern dark with data visualizations',
      slides: 8,
      language: 'en',
      model: 'deepseek/deepseek-chat-v3-0324', // optional
    }),
  }
)

const reader = res.body.getReader()
const decoder = new TextDecoder()
while (true) {
  const { done, value } = await reader.read()
  if (done) break
  for (const line of decoder.decode(value).split('\n')) {
    if (!line.startsWith('data: ')) continue
    const ev = JSON.parse(line.slice(6))
    console.log(ev.type, ev.message ?? '')
    if (ev.type === 'done') {
      console.log('Share URL:', ev.shareUrl)
      console.log('Slides:', ev.slideUrls)
    }
  }
}
```

Python (requests streaming)

```python
import json, requests

headers = {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY',
}

# 1. (Optional) List available models
models = requests.get(
    'https://www.magicslides.app/api/cli/models',
    headers=headers
).json()
print(models['default'])  # deepseek/deepseek-chat-v3-0324

# 2. Stream the generation
with requests.post(
    'https://www.magicslides.app/api/cli/generate-html-studio',
    headers=headers,
    json={
        'topic': 'Future of Remote Work',
        'style': 'modern dark with data visualizations',
        'slides': 8,
        'language': 'en',
        'model': 'deepseek/deepseek-chat-v3-0324',  # optional
    },
    stream=True
) as res:
    for line in res.iter_lines():
        if not line.startswith(b'data: '):
            continue
        ev = json.loads(line[6:])
        print(ev['type'], ev.get('message', ''))
        if ev['type'] == 'done':
            print('Share URL:', ev['shareUrl'])
            print('Slides:', ev['slideUrls'])
            break
```

### 4\. List Available Models

FreeJSON

Returns the list of AI model IDs you can pass as the `model` field in `POST /api/cli/generate-html-studio`. The default model is `deepseek/deepseek-chat-v3-0324`.

Endpoint

`GET https://www.magicslides.app/api/cli/models`

Response

```json
{
  "default": "deepseek/deepseek-chat-v3-0324",
  "models": [
    {
      "id": "deepseek/deepseek-chat-v3-0324",
      "name": "DeepSeek V3",
      "description": "Fast and cost-effective. Recommended default.",
      "recommended": true,
      "speed": "fast",
      "quality": "high"
    },
    {
      "id": "anthropic/claude-sonnet-4.6",
      "name": "Claude Sonnet 4.6",
      "description": "Excellent balance of quality and speed.",
      "recommended": false,
      "speed": "medium",
      "quality": "very high"
    },
    {
      "id": "anthropic/claude-haiku-4.5",
      "name": "Claude Haiku 4.5",
      "description": "Fastest model for simple topics.",
      "recommended": false,
      "speed": "very fast",
      "quality": "good"
    },
    {
      "id": "anthropic/claude-opus-4-7",
      "name": "Claude Opus 4.7",
      "description": "Most capable — best for complex, research-heavy decks.",
      "recommended": false,
      "speed": "slow",
      "quality": "excellent"
    }
  ],
  "usage": "Pass the model id as the model field in POST /api/cli/generate-html-studio"
}
```

cURL

```bash
curl https://www.magicslides.app/api/cli/models \
  -H "x-api-key: YOUR_API_KEY"
```

Legacy

## Legacy API Endpoints

These endpoints use `api.magicslides.app` as the base URL and authenticate via an `apiKey` body field. The unified endpoint is recommended for all new integrations.

### PPT-from-Text (Unified API)

Unified endpoint that handles all input types: topics, summaries, YouTube videos, websites, PDFs, and DOCX documents. Automatically detects input type and processes accordingly. Recommended for all new integrations.

POST

#### Endpoint URL

`https://api.magicslides.app/public/api/ppt-from-text`

#### Parameters

Parameter

Description

apiKey

Your API key from /dashboard/settings (recommended)

email

Your email address (required if apiKey not provided)

accessId

Your MagicSlides API access ID (required if apiKey not provided)

topic

Plain text topic, URL (auto-detected), or summary

summary

Plain text summary content

youtubeURL

YouTube video URL

websiteURL

Website URL to extract content from

pdfURL

PDF file URL

docxURL

DOCX file URL

template

Optional: Presentation template style (default: "bullet-point1")

language

Optional: Target language for the presentation (default: "en")

slideCount

Optional: Number of slides to generate (default: 10)

aiImages

Optional: Enable AI-generated images (default: false)

imageForEachSlide

Optional: Include images on every slide (default: true)

googleImage

Optional: Use Google Images instead of AI images (default: false)

googleText

Optional: Use Google search for content enhancement (default: false)

model

Optional: AI model to use - "gemini" or "gpt-4" (default: "gemini")

presentationFor

Optional: Target audience for the presentation

presentationCategory

Optional: Object with category, subCategory, and tone

watermark

Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

#### Example Usage

##### TypeScript/JavaScript

```typescript
import axios from 'axios';

const generateFromTopic = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        topic: 'Introduction to Quantum Computing: Understanding quantum mechanics, qubits, superposition, and quantum algorithms.',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        imageForEachSlide: true,
        aiImages: false
      }
    );

    console.log('Presentation URL:', response.data.url);
    console.log('PPT ID:', response.data.pptId);
  } catch (error) {
    console.error('Error:', error);
  }
};
```

##### Python

```python
import requests

def generate_from_topic():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt-from-text',
            json={
                'apiKey': 'ms-api-your-api-key-here',
                'topic': 'Introduction to Quantum Computing: Understanding quantum mechanics, qubits, superposition, and quantum algorithms.',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'imageForEachSlide': True,
                'aiImages': False
            }
        )
        response.raise_for_status()
        result = response.json()
        print('Presentation URL:', result['url'])
        print('PPT ID:', result['pptId'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
```

##### cURL

```bash
curl -X POST \
  'https://api.magicslides.app/public/api/ppt-from-text' \
  -H 'Content-Type: application/json' \
  -d '{
    "apiKey": "ms-api-your-api-key-here",
    "topic": "Introduction to Quantum Computing: Understanding quantum mechanics, qubits, superposition, and quantum algorithms.",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "imageForEachSlide": true,
    "aiImages": false
  }'
```

### Topic to PPT

DEPRECATED

Generate a customized presentation from any topic with AI. Control presentation style, length, language, and image options.

⚠️ This endpoint is deprecated but still functional. We recommend migrating to the unified **PPT-from-Text API** for all new integrations.

POST

#### Endpoint URL

`https://api.magicslides.app/public/api/ppt_from_topic`

#### Parameters

Parameter

Description

topic

The main topic for the presentation

extraInfoSource

Additional information to guide the presentation generation

email

Your email address

accessId

Your MagicSlides API access ID

template

Optional: Presentation template style (default: "bullet-point1")

language

Optional: Target language for the presentation (default: "en")

slideCount

Optional: Number of slides to generate (default: 10)

aiImages

Optional: Enable AI-generated images (default: false)

imageForEachSlide

Optional: Include images on every slide (default: true)

googleImage

Optional: Use Google Images instead of AI images (default: false)

googleText

Optional: Use Google search for content enhancement (default: false)

model

Optional: AI model to use - "gpt-4" or "gpt-3.5" (default: "gpt-4")

presentationFor

Optional: Target audience for the presentation

watermark

Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

#### Example Usage

##### TypeScript/JavaScript

```typescript
import axios from 'axios';

const generateFromTopic = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt_from_topic',
      {
        topic: 'Artificial Intelligence in Healthcare',
        extraInfoSource: 'Focus on recent developments and future prospects',
        email: 'your-email@example.com',
        accessId: 'your-access-id',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        aiImages: false,
        imageForEachSlide: true,
        googleImage: false,
        googleText: false,
        model: 'gpt-4',
        presentationFor: 'healthcare professionals',
        watermark: {
          width: '48',
          height: '48',
          brandURL: 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
          position: 'BottomRight'
        }
      }
    );

    console.log('Presentation URL:', response.data.url);
  } catch (error) {
    console.error('Error:', error);
  }
};
```

##### Python

```python
import requests

def generate_from_topic():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt_from_topic',
            json={
                'topic': 'Artificial Intelligence in Healthcare',
                'extraInfoSource': 'Focus on recent developments and future prospects',
                'email': 'your-email@example.com',
                'accessId': 'your-access-id',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'aiImages': False,
                'imageForEachSlide': True,
                'googleImage': False,
                'googleText': False,
                'model': 'gpt-4',
                'presentationFor': 'healthcare professionals',
                'watermark': {
                    'width': '48',
                    'height': '48',
                    'brandURL': 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
                    'position': 'BottomRight'
                }
            }
        )
        response.raise_for_status()
        print('Presentation URL:', response.json()['url'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
```

##### cURL

```bash
curl -X POST \
  'https://api.magicslides.app/public/api/ppt_from_topic' \
  -H 'Content-Type: application/json' \
  -d '{
    "topic": "Artificial Intelligence in Healthcare",
    "extraInfoSource": "Focus on recent developments and future prospects",
    "email": "your-email@example.com",
    "accessId": "your-access-id",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "aiImages": false,
    "imageForEachSlide": true,
    "googleImage": false,
    "googleText": false,
    "model": "gpt-4",
    "presentationFor": "healthcare professionals",
    "watermark": {
      "width": "48",
      "height": "48",
      "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
      "position": "BottomRight"
    }
  }'
```

### Summary to PPT

DEPRECATED

Generate a presentation from a text summary.

⚠️ This endpoint is deprecated but still functional. We recommend migrating to the unified **PPT-from-Text API** for all new integrations.

POST

#### Endpoint URL

`https://api.magicslides.app/public/api/ppt_from_summary`

#### Parameters

Parameter

Description

msSummaryText

The summary text to convert into a presentation

email

Your email address

accessId

Your MagicSlides API access ID

template

Optional: Presentation template style (default: "bullet-point1")

language

Optional: Target language for the presentation (default: "en")

slideCount

Optional: Number of slides to generate (default: 10)

aiImages

Optional: Enable AI-generated images (default: false)

imageForEachSlide

Optional: Include images on every slide (default: true)

googleImage

Optional: Use Google Images instead of AI images (default: false)

googleText

Optional: Use Google search for content enhancement (default: false)

model

Optional: AI model to use - "gpt-4" or "gpt-3.5" (default: "gpt-4")

presentationFor

Optional: Target audience for the presentation

watermark

Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

#### Example Usage

##### TypeScript/JavaScript

```typescript
import axios from 'axios';

const generateFromSummary = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt_from_summary',
      {
        msSummaryText: 'Your detailed summary text here...',
        email: 'your-email@example.com',
        accessId: 'your-access-id',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        aiImages: false,
        imageForEachSlide: true,
        googleImage: false,
        googleText: false,
        model: 'gpt-4',
        presentationFor: 'general audience',
        watermark: {
          width: '48',
          height: '48',
          brandURL: 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
          position: 'BottomRight'
        }
      }
    );

    console.log('Presentation URL:', response.data.url);
  } catch (error) {
    console.error('Error:', error);
  }
};
```

##### Python

```python
import requests

def generate_from_summary():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt_from_summary',
            json={
                'msSummaryText': 'Your detailed summary text here...',
                'email': 'your-email@example.com',
                'accessId': 'your-access-id',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'aiImages': False,
                'imageForEachSlide': True,
                'googleImage': False,
                'googleText': False,
                'model': 'gpt-4',
                'presentationFor': 'general audience',
                'watermark': {
                    'width': '48',
                    'height': '48',
                    'brandURL': 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
                    'position': 'BottomRight'
                }
            }
        )
        response.raise_for_status()
        print('Presentation URL:', response.json()['url'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
```

##### cURL

```bash
curl -X POST \
  'https://api.magicslides.app/public/api/ppt_from_summary' \
  -H 'Content-Type: application/json' \
  -d '{
    "msSummaryText": "Your detailed summary text here...",
    "email": "your-email@example.com",
    "accessId": "your-access-id",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "aiImages": false,
    "imageForEachSlide": true,
    "googleImage": false,
    "googleText": false,
    "model": "gpt-4",
    "presentationFor": "general audience",
    "watermark": {
      "width": "48",
      "height": "48",
      "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
      "position": "BottomRight"
    }
  }'
```

### YouTube to PPT

DEPRECATED

Generate a presentation from a YouTube video.

⚠️ This endpoint is deprecated but still functional. We recommend migrating to the unified **PPT-from-Text API** for all new integrations.

POST

#### Endpoint URL

`https://api.magicslides.app/public/api/ppt_from_youtube`

#### Parameters

Parameter

Description

youtubeURL

The YouTube video URL

email

Your email address

accessId

Your MagicSlides API access ID

template

Optional: Presentation template style (default: "bullet-point1")

language

Optional: Target language for the presentation (default: "en")

slideCount

Optional: Number of slides to generate (default: 10)

aiImages

Optional: Enable AI-generated images (default: false)

imageForEachSlide

Optional: Include images on every slide (default: true)

googleImage

Optional: Use Google Images instead of AI images (default: false)

googleText

Optional: Use Google search for content enhancement (default: false)

model

Optional: AI model to use - "gpt-4" or "gpt-3.5" (default: "gpt-4")

presentationFor

Optional: Target audience for the presentation

watermark

Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

#### Example Usage

##### TypeScript/JavaScript

```typescript
import axios from 'axios';

const generateFromYouTube = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt_from_youtube',
      {
        youtubeURL: 'https://www.youtube.com/watch?v=example',
        email: 'your-email@example.com',
        accessId: 'your-access-id',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        aiImages: false,
        imageForEachSlide: true,
        googleImage: false,
        googleText: false,
        model: 'gpt-4',
        presentationFor: 'general audience',
        watermark: {
          width: '48',
          height: '48',
          brandURL: 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
          position: 'BottomRight'
        }
      }
    );

    console.log('Presentation URL:', response.data.url);
  } catch (error) {
    console.error('Error:', error);
  }
};
```

##### Python

```python
import requests

def generate_from_youtube():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt_from_youtube',
            json={
                'youtubeURL': 'https://www.youtube.com/watch?v=example',
                'email': 'your-email@example.com',
                'accessId': 'your-access-id',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'aiImages': False,
                'imageForEachSlide': True,
                'googleImage': False,
                'googleText': False,
                'model': 'gpt-4',
                'presentationFor': 'general audience',
                'watermark': {
                    'width': '48',
                    'height': '48',
                    'brandURL': 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
                    'position': 'BottomRight'
                }
            }
        )
        response.raise_for_status()
        print('Presentation URL:', response.json()['url'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
```

##### cURL

```bash
curl -X POST \
  'https://api.magicslides.app/public/api/ppt_from_youtube' \
  -H 'Content-Type: application/json' \
  -d '{
    "youtubeURL": "https://www.youtube.com/watch?v=example",
    "email": "your-email@example.com",
    "accessId": "your-access-id",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "aiImages": false,
    "imageForEachSlide": true,
    "googleImage": false,
    "googleText": false,
    "model": "gpt-4",
    "presentationFor": "general audience",
    "watermark": {
      "width": "48",
      "height": "48",
      "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
      "position": "BottomRight"
    }
  }'
```

## Response Format

All API endpoints return a JSON response. The unified API returns:

```json
{
  "status": "success",
  "message": "Presentation generated successfully",
  "inputType": "topic",
  "url": "https://example.com/path/to/presentation.pptx",
  "pptId": "presentation-id",
  "pdfUrl": "https://example.com/path/to/presentation.pdf",
  "json": {
    "presentationTitle": "Title",
    "presentationSubtitle": "Subtitle",
    "slides": [...]
  },
  "tokenUsed": 1234,
  "openAICallTime": 5000
}
```

Deprecated endpoints may return a slightly different format with `success` and `data` fields.

## Error Handling

In case of an error, the API will return a JSON response with an error message:

```json
{
  "success": false,
  "error": "Invalid access ID provided",
  "code": "AUTH_ERROR"
}
```

## Rate Limits

The API is rate-limited to ensure fair usage. Please contact support for details about rate limits for your account.
