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

# Create Slide

> Add a new slide to an existing presentation. This is an async operation—poll the returned `generation_id` for completion.

The slide content will be transformed into a professionally designed slide with AI-generated layout and optional images.

Add a slide to an existing presentation. This is an **async operation** - poll the returned `generation_id` for completion.

## Path Parameters

| Parameter         | Type   | Description                                |
| ----------------- | ------ | ------------------------------------------ |
| `presentation_id` | string | ID of the presentation to add the slide to |

***

## Request Body

| Parameter                          | Type    | Default     | Description                                                                                                                         |
| ---------------------------------- | ------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `slide_context`                    | string  | (required)  | Content for this slide                                                                                                              |
| `options.additional_instructions`  | string  | -           | Extra instructions for slide generation                                                                                             |
| `options.slide_type`               | string  | `"classic"` | Slide style: `classic` for structured, editable text-led slides, or `creative` for image-led slides generated with Nano Banana Pro. |
| `options.slide_order`              | integer | (end)       | Position in presentation (0-indexed)                                                                                                |
| `options.total_variants_per_slide` | integer | 1           | Variants to generate (1-4)                                                                                                          |
| `export_formats`                   | array   | `["link"]`  | Formats to export: `link`, `pdf`, `ppt`                                                                                             |

***

## Response

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

Poll `GET /generations/{generation_id}` until status is `completed`. The response will include `slide_id`.

***

## Example

```bash theme={null}
curl -X POST "https://slides-api.getalai.com/api/v1/presentations/xyz789-.../slides" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "slide_context": "Key achievements: 25% revenue growth, 50 new clients",
    "options": {
      "additional_instructions": "Make it visual with icons"
    }
  }'
```

### Creative (Image-Led) Slide

```bash theme={null}
curl -X POST "https://slides-api.getalai.com/api/v1/presentations/xyz789-.../slides" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "slide_context": "Hero shot of our new product against a sunset backdrop",
    "options": {
      "slide_type": "creative"
    }
  }'
```

***

## Status Response

When polling, the status response includes `slide_id`:

```json theme={null}
{
  "generation_id": "abc123-...",
  "generation_type": "slide_creation",
  "status": "completed",
  "presentation_id": "xyz789-...",
  "slide_id": "slide123-...",
  "formats": {
    "link": {
      "status": "completed",
      "url": "https://app.getalai.com/view/..."
    }
  }
}
```


## OpenAPI

````yaml POST /api/v1/presentations/{presentation_id}/slides
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/presentations/{presentation_id}/slides:
    post:
      tags:
        - External API
      summary: Add a slide to an existing presentation
      description: >-
        Add a new slide to an existing presentation. This is an async
        operation—poll the returned `generation_id` for completion.


        The slide content will be transformed into a professionally designed
        slide with AI-generated layout and optional images.
      operationId: create_slide_api_v1_presentations__presentation_id__slides_post
      parameters:
        - name: presentation_id
          in: path
          required: true
          schema:
            type: string
            title: Presentation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSlideContentInput'
      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:
    CreateSlideContentInput:
      properties:
        slide_context:
          type: string
          title: Slide Context
          description: Content for this slide.
        options:
          $ref: '#/components/schemas/CreateSlideOptions'
        export_formats:
          items:
            $ref: '#/components/schemas/ApiExportFormat'
          type: array
          title: Export Formats
          description: The formats in which the generation will make the slide available
          default:
            - link
      type: object
      required:
        - slide_context
      title: CreateSlideContentInput
    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
    CreateSlideOptions:
      properties:
        additional_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Additional Instructions
          description: Guidance for the AI on this specific slide's style or content focus.
        slide_type:
          $ref: '#/components/schemas/SlideType'
          description: >-
            Slide style: 'classic' for structured editable text-led slides, or
            'creative' for image-led slides generated with Nano Banana Pro.
          default: classic
        slide_order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Slide Order
          description: >-
            Position in the presentation (0-indexed). If omitted, appends to the
            end.
        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
      type: object
      title: CreateSlideOptions
    ApiExportFormat:
      type: string
      enum:
        - link
        - pdf
        - ppt
      title: ApiExportFormat
    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
    SlideType:
      type: string
      enum:
        - classic
        - creative
      title: SlideType
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Your Alai API key. Get one from your account settings at app.getalai.com

````