# Quick Start - MagicSlides API

> Get started with the MagicSlides API in minutes. Learn how to make your first API call and generate presentations programmatically.

Source: https://www.magicslides.app/docs-api/quick-start
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

---
# Quick Start

Get up and running with the MagicSlides API in just a few minutes. Follow these simple steps to generate your first presentation.

1

## Get Your API Key

Your API key is your unique authentication token for all API requests. You can get it from your MagicSlides dashboard settings.

### Get Your API Key

1.  Open your MagicSlides dashboard settings
2.  Generate a new API key
3.  Copy your API key (format: `ms-api-...`)

[Open dashboard settings →](https://www.magicslides.app/dashboard/settings/api)

#### Alternative: Using Email and AccessId

For backward compatibility, you can also use your account email and Access ID instead of an API key — find both in your [dashboard settings](https://www.magicslides.app/dashboard/settings/api). API key authentication is recommended.

2

## Make Your First API Call

Let's generate a presentation from a topic. This is the simplest endpoint to get started with.

### Endpoint

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

This is the unified API endpoint that handles all input types (topics, summaries, YouTube, websites, PDFs, DOCX).

### Choose Your Language

#### TypeScript/JavaScript

```typescript
import axios from 'axios';

async function generatePresentation() {
  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 Artificial Intelligence',
        language: 'en',
        slideCount: 5
      },
      {
        headers: {
          'Content-Type': 'application/json'
        }
      }
    );

    console.log('Success!', response.data);
    console.log('Presentation URL:', response.data.url);
    console.log('PPT ID:', response.data.pptId);
    return response.data;
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
    throw error;
  }
}

// Call the function
generatePresentation();
```

#### Python

```python
import requests

def generate_presentation():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt-from-text',
            json={
                'apiKey': 'ms-api-your-api-key-here',
                'topic': 'Introduction to Artificial Intelligence',
                'language': 'en',
                'slideCount': 5
            },
            headers={
                'Content-Type': 'application/json'
            }
        )
        response.raise_for_status()

        data = response.json()
        print('Success!', data)
        print('Presentation URL:', data['url'])
        print('PPT ID:', data['pptId'])
        return data
    except requests.exceptions.RequestException as e:
        print('Error:', e.response.json() if e.response else str(e))
        raise

# Call the function
generate_presentation()
```

#### 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 Artificial Intelligence",
    "language": "en",
    "slideCount": 5
  }'
```

#### Important Notes

-   Replace `ms-api-your-api-key-here` with your API key from Step 1
-   The `slideCount` parameter is optional (default: 10, max: 50)
-   All other parameters are optional - this minimal example will work!
-   You can also use `email` and `accessId` instead of `apiKey` for backward compatibility

3

## Handle the Response

The API will return a JSON response with your presentation URL and metadata.

### Success Response

```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": "Introduction to Artificial Intelligence",
    "slides": [...]
  },
  "tokenUsed": 1234
}
```

Your generated deck

Presentation

### Introduction to Artificial Intelligence

What AI is, how it works, and where it's headed

MagicSlides

### Error Response

```json
{
  "status": "failed",
  "message": "Invalid API key",
  "error": {
    "field": "apiKey",
    "message": "Invalid API key",
    "code": "AUTH_ERROR"
  }
}
```

#### What to do with the response:

-   The `url` contains the download link for your presentation
-   The `pptId` is a unique identifier for the presentation
-   The `pdfUrl` contains a PDF version if available
-   You can download the file, share the URL, or embed it in your application
-   The presentation is available in PPTX format
-   Always check the `status` field before accessing the data

## Next Steps

Now that you've made your first API call, explore more features:

[

### Topic to PPT

Learn about all available parameters for topic-based generation

](https://www.magicslides.app/docs-api/topic)[

### Summary to PPT

Generate presentations from text summaries

](https://www.magicslides.app/docs-api/summary)[

### YouTube to PPT

Convert YouTube videos into presentations

](https://www.magicslides.app/docs-api/youtube)[

### Authentication

Learn about security best practices

](https://www.magicslides.app/docs-api/auth)

## Common Issues

### Error: Invalid API key

Make sure you've copied your API key correctly and haven't included any extra spaces. Verify it in your dashboard settings. If using email/accessId, ensure both are correct.

### Error: Rate limit exceeded

You've made too many requests. Wait a few minutes before trying again. Check the [rate limits page](https://www.magicslides.app/docs-api/rate-limits) for details.

### No response or timeout

Presentation generation can take 30-60 seconds. Make sure your code handles async operations properly and has appropriate timeout settings.

## Need Help?

If you're stuck or have questions, we're here to help:

[Error Handling Guide](https://www.magicslides.app/docs-api/errors)[Contact Support](https://www.magicslides.app/support)[Full Documentation](https://www.magicslides.app/docs-api)
