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

# Generate Presentation

> Create a new presentation from text content. This is an async operation.

**Workflow:**
1. Submit your content and options
2. Receive a `generation_id` immediately
3. Poll `GET /generations/{generation_id}` until status is `completed` or `failed`
4. Access your presentation via the URLs in the response

**Rate limit:** Max 5 concurrent generations per user.

Generate a presentation from text content. This is an **async operation** - you receive a `generation_id` immediately and poll for results.

## Workflow

1. **Submit** your content with `POST /generations`
2. **Receive** a `generation_id` immediately
3. **Poll** `GET /generations/{generation_id}` until `status` is `completed` or `failed`
4. **Access** your presentation via URLs in the `formats` field

***

## Request Body

### Required

| Parameter    | Type   | Description                                                                         |
| ------------ | ------ | ----------------------------------------------------------------------------------- |
| `input_text` | string | Content to transform into slides. Can be plain text, markdown, or structured notes. |

### Optional Top-Level Fields

| Parameter                 | Type             | Description                                                                                                                |
| ------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `additional_instructions` | string           | Extra guidance for the AI on style, focus areas, or specific requirements not captured by other options.                   |
| `image_ids`               | array of strings | IDs (UUIDs) of previously uploaded images from `POST /upload-images`. Images are matched to relevant slides automatically. |

### Export Formats

| Parameter        | Type  | Default    | Description                                                    |
| ---------------- | ----- | ---------- | -------------------------------------------------------------- |
| `export_formats` | array | `["link"]` | Formats to export: `link`, `pdf`, `ppt`. Can request multiple. |

### Presentation Options

| Parameter                                       | Type    | Default                                  | Description                                                                                                                                                                                                            |
| ----------------------------------------------- | ------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `presentation_options.title`                    | string  | "API Generated Presentation"             | Title shown on title slide and in exports                                                                                                                                                                              |
| `presentation_options.theme_id`                 | string  | `"27874e6b-8c1c-4301-bce7-d22e6e8df7d6"` | Theme ID controlling colors, fonts, and styling. Use `GET /themes` to discover available theme IDs. Legacy theme display names are still accepted for backward compatibility, but deprecated.                          |
| `presentation_options.slide_range`              | string  | "auto"                                   | Target slide count: `auto`, `1`, `2-5`, `6-10`, `11-15`, `16-20`, `21-25`, `26-50`                                                                                                                                     |
| `presentation_options.existing_presentation_id` | string  | -                                        | Append slides to existing presentation                                                                                                                                                                                 |
| `presentation_options.total_variants_per_slide` | integer | 1                                        | Variants per slide (1-4)                                                                                                                                                                                               |
| `presentation_options.vibe_id`                  | string  | -                                        | Vibe ID controlling the visual aesthetic of creative variants. Use `GET /vibes` to discover available vibe IDs. Requires `image_options.num_image_variants >= 1` when set. If omitted, standard theme styling is used. |

### Text Options

| Parameter               | Type   | Default | Description     |
| ----------------------- | ------ | ------- | --------------- |
| `text_options.language` | string | (auto)  | Output language |

### Image Options

| Parameter                          | Type    | Default | Description                                                                                                                                                   |
| ---------------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `image_options.include_ai_images`  | boolean | true    | Generate AI images                                                                                                                                            |
| `image_options.include_web_images` | boolean | true    | Search the web for relevant images to include in slides                                                                                                       |
| `image_options.style`              | string  | "auto"  | Image style: `auto`, `realistic`, `artistic`, `cartoon`, `three_d`, `custom`                                                                                  |
| `image_options.style_instructions` | string  | -       | Required when style is `custom`                                                                                                                               |
| `image_options.num_image_variants` | integer | 0       | Number of creative image-led slide variants generated using Nano Banana Pro (0-2). Required (>=1) when `presentation_options.vibe_id` is set. Increases cost. |

***

## Response

```json theme={null}
{
  "generation_id": "abc123-def456-789..."
}
```

Use this `generation_id` to poll `GET /generations/{generation_id}` for status.

***

## Examples

### Basic Generation

```bash theme={null}
curl -X POST "https://slides-api.getalai.com/api/v1/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_text": "Our company achieved 25% revenue growth this quarter."
  }'
```

### With Multiple Export Formats

```bash theme={null}
# First, discover a theme ID with GET /themes
curl -X POST "https://slides-api.getalai.com/api/v1/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_text": "Quarterly sales report content...",
    "export_formats": ["link", "pdf", "ppt"],
    "presentation_options": {
      "title": "Q4 Sales Report",
      "theme_id": "27874e6b-8c1c-4301-bce7-d22e6e8df7d6",
      "slide_range": "6-10"
    },
  }'
```

<Note>
  `theme_id` now primarily expects a theme ID from `GET /themes`. Legacy theme display names still work for backward compatibility, but they are deprecated.
</Note>

### With a Vibe

Vibes are visual aesthetic presets applied through creative image variants. Discover available vibe IDs with `GET /vibes`.

```bash theme={null}
curl -X POST "https://slides-api.getalai.com/api/v1/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_text": "Launch announcement for our new product line",
    "presentation_options": {
      "title": "Product Launch",
      "vibe_id": "f1c2d3e4-5678-90ab-cdef-1234567890ab",
      "slide_range": "6-10"
    },
    "image_options": {
      "num_image_variants": 1
    }
  }'
```

<Note>
  When `vibe_id` is set, `image_options.num_image_variants` must be `>= 1`. Vibes are applied through creative image variants.
</Note>

### Add to Existing Presentation

```bash theme={null}
curl -X POST "https://slides-api.getalai.com/api/v1/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_text": "Additional slides content...",
    "presentation_options": {
      "existing_presentation_id": "xyz789-...",
      "slide_range": "2-5"
    }
  }'
```

<Tip>
  Request multiple `export_formats` in a single call to get link, PDF, and PPT
  all at once. Check the `formats` object in the status response for download URLs.
</Tip>


## OpenAPI

````yaml POST /api/v1/generations
openapi: 3.1.0
info:
  title: Alai API
  description: API endpoints for programmatic access to Alai presentation generation
  version: 1.0.0
servers:
  - url: https://slides-api.getalai.com
security:
  - BearerAuth: []
paths:
  /api/v1/generations:
    post:
      tags:
        - External API
      summary: Generate a presentation
      description: >-
        Create a new presentation from text content. This is an async operation.


        **Workflow:**

        1. Submit your content and options

        2. Receive a `generation_id` immediately

        3. Poll `GET /generations/{generation_id}` until status is `completed`
        or `failed`

        4. Access your presentation via the URLs in the response


        **Rate limit:** Max 5 concurrent generations per user.
      operationId: generate_presentation_api_v1_generations_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeneratePresentationInput'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalApiGenerationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GeneratePresentationInput:
      properties:
        input_text:
          type: string
          title: Input Text
          description: >-
            Content to transform into slides. Can be plain text, markdown, or
            structured notes. Longer input typically produces more slides.
        additional_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Additional Instructions
          description: >-
            Guidance for the AI on style, focus areas, or specific requirements
            not captured in other options.
        image_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Image Ids
          description: >-
            IDs of previously uploaded images (from POST /upload-images) to
            incorporate. Images are matched to relevant slides automatically.
        export_formats:
          items:
            $ref: '#/components/schemas/ApiExportFormat'
          type: array
          title: Export Formats
          description: >-
            Formats to export upon completion. 'link' is a shareable web URL.
            'pdf' and 'ppt' provide downloadable files.
          default:
            - link
        presentation_options:
          $ref: '#/components/schemas/PresentationOptions'
        text_options:
          $ref: '#/components/schemas/TextOptions'
        image_options:
          $ref: '#/components/schemas/ImageOptions'
      type: object
      required:
        - input_text
      title: GeneratePresentationInput
    ExternalApiGenerationResponse:
      properties:
        generation_id:
          type: string
          title: Generation Id
          description: >-
            Unique identifier to poll for generation status via GET
            /generations/{generation_id}
      type: object
      required:
        - generation_id
      title: ExternalApiGenerationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiExportFormat:
      type: string
      enum:
        - link
        - pdf
        - ppt
      title: ApiExportFormat
    PresentationOptions:
      properties:
        title:
          type: string
          title: Title
          description: Presentation title shown on the title slide and in exports
          default: API Generated Presentation
        theme_id:
          type: string
          title: Theme Id
          description: >-
            Theme ID controlling colors, fonts, and styling. Use GET /themes to
            discover available theme IDs. Legacy theme display names are still
            accepted for backward compatibility, but deprecated.
          default: 27874e6b-8c1c-4301-bce7-d22e6e8df7d6
        slide_range:
          $ref: '#/components/schemas/SlideRange'
          description: >-
            Target slide count. 'auto' analyzes input length. '1' generates a
            single slide. Ranges like '2-5' set bounds.
          default: auto
        existing_presentation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Existing Presentation Id
          description: >-
            Append slides to an existing presentation instead of creating a new
            one
        total_variants_per_slide:
          type: integer
          maximum: 4
          minimum: 1
          title: Total Variants Per Slide
          description: Number of distinct options to generate for each slide
          default: 1
        vibe_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Vibe Id
          description: >-
            Vibe ID controlling the visual aesthetic of creative variants. Use
            GET /vibes to list available IDs. Requires
            image_options.num_image_variants >= 1 when set. If omitted, standard
            theme styling is used.
      type: object
      title: PresentationOptions
    TextOptions:
      properties:
        language:
          anyOf:
            - $ref: '#/components/schemas/LanguageType'
            - type: 'null'
          description: Output language. If not set, matches the input language.
      type: object
      title: TextOptions
    ImageOptions:
      properties:
        include_ai_images:
          type: boolean
          title: Include Ai Images
          description: >-
            Generate AI images for slides. Disable to use only uploaded images
            or no images.
          default: true
        include_web_images:
          type: boolean
          title: Include Web Images
          description: Search the web for relevant images to include in slides.
          default: true
        style:
          $ref: '#/components/schemas/AIImageStyleType'
          description: >-
            AI image style: 'auto' (content-aware), 'realistic', 'artistic',
            'cartoon', 'three_d', or 'custom'.
          default: auto
        style_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Style Instructions
          description: Required when style='custom'. Describe the desired image aesthetic.
        num_image_variants:
          type: integer
          maximum: 2
          minimum: 0
          title: Num Image Variants
          description: >-
            Number of image slide variants generated using Nano Banana Pro.
            Increases cost.
          default: 0
      type: object
      title: ImageOptions
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SlideRange:
      type: string
      enum:
        - '1'
        - auto
        - 2-5
        - 6-10
        - 11-15
        - 16-20
        - 21-25
        - 26-50
      title: SlideRange
    LanguageType:
      type: string
      enum:
        - English (US)
        - English (UK)
        - Spanish (Latin America)
        - Spanish (Mexico)
        - Spanish (Spain)
        - French
        - German
        - Italian
        - Portuguese (Brazil)
        - Portuguese (Portugal)
        - Dutch
        - Polish
        - Russian
        - Japanese
        - Korean
        - Chinese (Simplified)
        - Hindi
        - Swedish
        - Norwegian
        - Danish
        - Finnish
        - Greek
        - Turkish
        - Czech
        - Hungarian
        - Romanian
        - Bulgarian
        - Ukrainian
        - Vietnamese
        - Thai
        - Indonesian
        - Serbian
        - Croatian
        - Bosnian
        - Slovenian
        - Macedonian
        - Albanian
        - Montenegrin
        - Lithuanian
      title: LanguageType
    AIImageStyleType:
      type: string
      enum:
        - auto
        - realistic
        - artistic
        - cartoon
        - three_d
        - custom
      title: AIImageStyleType
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Your Alai API key. Get one from your account settings at app.getalai.com

````