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

# Check Generation Status

> Poll this endpoint to check the status of any async operation (presentation generation, slide creation, export, or transcript generation).

**Status values:**
- `pending` - Queued, not yet started
- `in_progress` - Currently processing
- `completed` - Finished successfully; results available in response
- `failed` - Error occurred; check `error` field for details

**Recommended polling:** Every 2-5 seconds. Most generations complete within 30-120 seconds.

Poll this endpoint to check the status of any async operation (presentation generation, slide creation, export, or transcript generation).

## Status Values

| Status        | Description                              |
| ------------- | ---------------------------------------- |
| `pending`     | Queued, not yet started                  |
| `in_progress` | Currently processing                     |
| `completed`   | Finished successfully; results available |
| `failed`      | Error occurred; check `error` field      |

**Recommended polling:** Every 5 seconds. Most operations complete within 1-3 minutes depending on slide count.

***

## Response Fields

| Field             | Type   | Description                       |
| ----------------- | ------ | --------------------------------- |
| `generation_id`   | string | The generation ID you're polling  |
| `status`          | string | Current status                    |
| `error`           | string | Error message (when `failed`)     |
| `created_at`      | string | ISO 8601 timestamp                |
| `completed_at`    | string | When generation finished          |
| `presentation_id` | string | ID of the presentation            |
| `formats`         | object | Export results (when `completed`) |

***

## Format Results

When status is `completed`, the `formats` object contains results for each requested format:

```json theme={null}
{
  "generation_id": "abc123-...",
  "status": "completed",
  "presentation_id": "xyz789-...",
  "formats": {
    "link": {
      "status": "completed",
      "url": "https://app.getalai.com/view/..."
    },
    "pdf": {
      "status": "completed",
      "url": "https://storage.../presentation.pdf"
    },
    "ppt": {
      "status": "completed",
      "url": "https://storage.../presentation.pptx"
    }
  }
}
```

Each format has:

* `status`: `completed`, `failed`, or `skipped`
* `url`: Signed download URL (valid for 24 hours)
* `error`: Error message if failed

***

## Example

```bash theme={null}
curl "https://slides-api.getalai.com/api/v1/generations/abc123-def456-..." \
  -H "Authorization: Bearer YOUR_API_KEY"
```

***

## Polling Example (Python)

```python theme={null}
import time
import requests

def wait_for_generation(generation_id, api_key, max_wait=300):
    url = f"https://slides-api.getalai.com/api/v1/generations/{generation_id}"
    headers = {"Authorization": f"Bearer {api_key}"}

    start = time.time()
    while time.time() - start < max_wait:
        response = requests.get(url, headers=headers)
        data = response.json()

        if data["status"] == "completed":
            return data
        elif data["status"] == "failed":
            raise Exception(data.get("error", "Generation failed"))

        time.sleep(3)  # Poll every 3 seconds

    raise TimeoutError("Generation timed out")

# Usage
result = wait_for_generation("abc123-...", "YOUR_API_KEY")
print(result["formats"]["link"]["url"])
```

<Tip>
  Download URLs in the `formats` object are signed and valid for 24 hours.
  Store the `presentation_id` if you need to export again later.
</Tip>


## OpenAPI

````yaml GET /api/v1/generations/{generation_id}
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/{generation_id}:
    get:
      tags:
        - External API
      summary: Check generation status
      description: >-
        Poll this endpoint to check the status of any async operation
        (presentation generation, slide creation, export, or transcript
        generation).


        **Status values:**

        - `pending` - Queued, not yet started

        - `in_progress` - Currently processing

        - `completed` - Finished successfully; results available in response

        - `failed` - Error occurred; check `error` field for details


        **Recommended polling:** Every 2-5 seconds. Most generations complete
        within 30-120 seconds.
      operationId: get_generation_status_api_v1_generations__generation_id__get
      parameters:
        - name: generation_id
          in: path
          required: true
          schema:
            type: string
            title: Generation Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PresentationGenerationStatus'
                  - $ref: '#/components/schemas/SlideCreationStatus'
                  - $ref: '#/components/schemas/ExportStatus'
                  - $ref: '#/components/schemas/TranscriptStatus'
                title: >-
                  Response Get Generation Status Api V1 Generations  Generation
                  Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PresentationGenerationStatus:
      properties:
        generation_id:
          type: string
          title: Generation Id
        status:
          $ref: '#/components/schemas/ApiGenerationStatus'
          description: 'Current state: pending → in_progress → completed/failed'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Human-readable error message when status is 'failed'
        created_at:
          type: string
          title: Created At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
          description: ISO 8601 timestamp when generation finished
        generation_type:
          type: string
          const: presentation_generation
          title: Generation Type
          default: presentation_generation
        presentation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Presentation Id
          description: >-
            Available once generation starts. Use this ID for subsequent
            operations.
        formats:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/FormatResult'
              type: object
            - type: 'null'
          title: Formats
          description: >-
            Export results keyed by format ('link', 'pdf', 'ppt'). Only present
            when completed.
      type: object
      required:
        - generation_id
        - status
        - created_at
      title: PresentationGenerationStatus
    SlideCreationStatus:
      properties:
        generation_id:
          type: string
          title: Generation Id
        status:
          $ref: '#/components/schemas/ApiGenerationStatus'
          description: 'Current state: pending → in_progress → completed/failed'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Human-readable error message when status is 'failed'
        created_at:
          type: string
          title: Created At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
          description: ISO 8601 timestamp when generation finished
        generation_type:
          type: string
          const: slide_creation
          title: Generation Type
          default: slide_creation
        presentation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Presentation Id
        slide_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Slide Id
          description: ID of the newly created slide. Available when completed.
        formats:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/FormatResult'
              type: object
            - type: 'null'
          title: Formats
          description: Export results if export_formats were requested
      type: object
      required:
        - generation_id
        - status
        - created_at
      title: SlideCreationStatus
    ExportStatus:
      properties:
        generation_id:
          type: string
          title: Generation Id
        status:
          $ref: '#/components/schemas/ApiGenerationStatus'
          description: 'Current state: pending → in_progress → completed/failed'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Human-readable error message when status is 'failed'
        created_at:
          type: string
          title: Created At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
          description: ISO 8601 timestamp when generation finished
        generation_type:
          type: string
          const: presentation_export
          title: Generation Type
          default: presentation_export
        presentation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Presentation Id
        formats:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/FormatResult'
              type: object
            - type: 'null'
          title: Formats
          description: Export results keyed by format ('link', 'pdf', 'ppt')
      type: object
      required:
        - generation_id
        - status
        - created_at
      title: ExportStatus
    TranscriptStatus:
      properties:
        generation_id:
          type: string
          title: Generation Id
        status:
          $ref: '#/components/schemas/ApiGenerationStatus'
          description: 'Current state: pending → in_progress → completed/failed'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Human-readable error message when status is 'failed'
        created_at:
          type: string
          title: Created At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
          description: ISO 8601 timestamp when generation finished
        generation_type:
          type: string
          const: transcript_generation
          title: Generation Type
          default: transcript_generation
        presentation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Presentation Id
        transcripts:
          anyOf:
            - items:
                $ref: '#/components/schemas/SlideTranscript'
              type: array
            - type: 'null'
          title: Transcripts
          description: Speaker notes for each slide, ordered by slide_order
      type: object
      required:
        - generation_id
        - status
        - created_at
      title: TranscriptStatus
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiGenerationStatus:
      type: string
      enum:
        - pending
        - in_progress
        - completed
        - failed
      title: ApiGenerationStatus
    FormatResult:
      properties:
        status:
          type: string
          title: Status
          description: 'Export status: ''completed'', ''failed'', or ''skipped'''
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: Signed URL to download the exported file. Valid for 24 hours.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if export failed for this format
      type: object
      required:
        - status
      title: FormatResult
    SlideTranscript:
      properties:
        slide_id:
          type: string
          title: Slide Id
        slide_order:
          type: integer
          title: Slide Order
          description: Position in the presentation (0-indexed)
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Slide heading, if present
        content:
          type: string
          title: Content
          description: Generated speaker notes for this slide
        layout:
          type: string
          title: Layout
          description: Layout type used for this slide
      type: object
      required:
        - slide_id
        - slide_order
        - content
        - layout
      title: SlideTranscript
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Your Alai API key. Get one from your account settings at app.getalai.com

````