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

Generate the initial Modern artifact using Alai's agentic presentation workflow. The request returns `202 Accepted` with an operation to poll.

`slide_count` is exact when supplied. `asset_ids` must refer to assets uploaded to this presentation. Use a model ID returned by `GET /models`, or omit `model` to use the default.

```json theme={null}
{
  "content": "Pitch content and source material...",
  "instructions": "Create a polished client pitch for a radio station.",
  "slide_count": 8,
  "asset_ids": ["LOGO_ASSET_ID"],
  "model": {
    "id": "anthropic/claude-opus-4.8",
    "fallback_policy": "deny"
  },
  "idempotency_key": "futuri-job-123"
}
```

Poll `GET /operations/{operation_id}` until the operation reaches `succeeded` or `failed`.


## OpenAPI

````yaml POST /api/modern/v1/presentations/{presentation_id}/generate
openapi: 3.1.0
info:
  title: Alai API
  description: API endpoints for Alai Classic, Creative, and Modern presentation generation
  version: 1.1.0
servers:
  - url: https://slides-api.getalai.com
security:
  - BearerAuth: []
paths:
  /api/modern/v1/presentations/{presentation_id}/generate:
    post:
      tags:
        - Modern Slides API
      summary: Generate Presentation
      operationId: >-
        generate_presentation_api_modern_v1_presentations__presentation_id__generate_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/ModernApiGenerateInput'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModernApiOperation'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ModernApiGenerateInput:
      properties:
        content:
          type: string
          maxLength: 100000
          minLength: 1
          title: Content
        instructions:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Instructions
        slide_count:
          anyOf:
            - type: integer
              maximum: 50
              minimum: 1
            - type: 'null'
          title: Slide Count
        asset_ids:
          items:
            type: string
          type: array
          maxItems: 20
          title: Asset Ids
        model:
          anyOf:
            - $ref: '#/components/schemas/ModernApiModelSelection'
            - type: 'null'
        idempotency_key:
          anyOf:
            - type: string
              maxLength: 128
              minLength: 1
            - type: 'null'
          title: Idempotency Key
      additionalProperties: false
      type: object
      required:
        - content
      title: ModernApiGenerateInput
    ModernApiOperation:
      properties:
        id:
          type: string
          title: Id
        operation_type:
          type: string
          enum:
            - generate
            - edit
            - export
          title: Operation Type
        presentation_id:
          type: string
          title: Presentation Id
        status:
          $ref: '#/components/schemas/ModernApiOperationStatus'
        progress:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Progress
        result:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
      type: object
      required:
        - id
        - operation_type
        - presentation_id
        - status
      title: ModernApiOperation
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ModernApiModelSelection:
      properties:
        id:
          $ref: '#/components/schemas/AgentPrimaryModel'
        fallback_policy:
          type: string
          const: deny
          title: Fallback Policy
          default: deny
      additionalProperties: false
      type: object
      required:
        - id
      title: ModernApiModelSelection
    ModernApiOperationStatus:
      type: string
      enum:
        - queued
        - running
        - succeeded
        - failed
      title: ModernApiOperationStatus
    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
    AgentPrimaryModel:
      type: string
      enum:
        - openai/gpt-5.6-sol
        - openai/gpt-5.6-terra
        - anthropic/claude-opus-4.8
        - anthropic/claude-sonnet-5
        - anthropic/claude-sonnet-4-6
        - anthropic/claude-haiku-4-5
        - google/gemini-3.1-pro-preview
        - moonshotai/kimi-k2.6
        - z-ai/glm-5.2
        - anthropic/claude-opus-4.8-fast
        - anthropic/claude-fable-5
      title: AgentPrimaryModel
      description: >-
        Selectable primary model for the modern deck and design system agents.


        Values are OpenRouter model IDs (see OpenRouterModels in
        ai_models/model_list.py).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Your Alai API key. Get one from your account settings at app.getalai.com

````