Skip to main content
This guide provides complete, working examples for common Alai API workflows. All examples use Python with the requests library.

Installation


AlaiClient Helper Class

Copy this helper class to simplify your Alai API integrations. It handles polling, error handling, and provides a clean interface for all operations.
Save this as alai_client.py and import it in your projects: from alai_client import AlaiClient

Example 1: Generate a Simple Presentation

The most basic use case - turn text into a presentation.

Example 2: Weekly Report Generator

Automate recurring presentations like weekly reports.

Example 3: Document to Slides

Convert meeting notes, documents, or any text file into a presentation.
The API automatically structures your content into logical slides. For best results, use clear headings and bullet points in your source text.

Example 4: Add Slides to Existing Presentation

Build presentations incrementally by adding slides one at a time.

Example 5: Batch Processing

Generate multiple presentations efficiently.
Respect the rate limit of 5 concurrent generations. For large batches, process sequentially or add delays between requests.

Example 6: Presentations with Custom Images

Upload your own images to include in presentations.
Supported image formats: PNG, JPEG, WebP, GIF, AVIF, SVG. Max 10MB per file, 10 images per upload.

Error Handling Best Practices

Robust error handling for production use.

Next Steps

API Reference

Detailed documentation for all endpoints and parameters

Get Themes

Discover theme IDs and names available to your account