---
title: "Render Python"
method: POST
path: "/api/v1/slides/render-python"
tags: ["slides"]
---

# Render Python

`POST /api/v1/slides/render-python`

## Request

- Base URL: `https://api.slidemaster.tw` (the document declares no server; this is the origin it was published from)
- URL: `https://api.slidemaster.tw/api/v1/slides/render-python`
- Auth: none declared

Stream NDJSON events as each slide completes.

Response is `application/x-ndjson` — one JSON object per line. Event types:

  {"event": "started", "total": N}
  {"event": "slide_done", "completed": K, "total": N, "preview": {...}}
  {"event": "stitching"}
  {"event": "complete", "project_id": ..., "stitched_pptx_url": ...,
    "slide_previews": [...], "total_credits_charged": int,
    "total_slides": int, "total_duration_ms": int}
  {"event": "error", "status": int, "error": str}   # fatal — no further events

Frontend consumes per-line so the UI can show "5/9 done" etc. before the
full batch finishes (some slides take 60s+ when audit retries fire).

Errors that abort the whole request emit a single `error` event then end
the stream. Per-slide failures emit a `slide_done` with status="failed"
and the stream continues.

## Headers

- `Authorization` string, nullable

## Request body

- RenderPythonRequest
  - `project_id` string, required
  - `slide_specs` SlideSpec[], required
    - `slide_id` string, required
    - `slide_number` integer, required
    - `title` string
    - `subtitle` string, nullable
    - `body` string, nullable
    - `points` unknown[]
      - unknown
    - `bullet_points` unknown[]
      - unknown
    - `items` unknown[]
      - unknown
    - `steps` unknown[]
      - unknown
    - `sections` unknown[]
      - unknown
    - `cards` unknown[]
      - unknown
    - `left_bullets` unknown[]
      - unknown
    - `right_bullets` unknown[]
      - unknown
    - `charts` object[]
    - `label` string, nullable
    - `number` string, nullable
    - `delta` string, nullable
    - `description` string, nullable
    - `quote` string, nullable
    - `author` string, nullable
    - `author_role` string, nullable
    - `heading` string, nullable
    - `sub` string, nullable
    - `button_text` string, nullable
    - `url` string, nullable
    - `qr_label` string, nullable
    - `left_title` string, nullable
    - `right_title` string, nullable
    - `background` string, nullable
    - `decoration` string, nullable
    - `design_notes` string, nullable
    - `headers` string[]
    - `rows` array[]
      - unknown[]
        - unknown
    - `table` object, nullable
    - `tables` object[]
    - `layout_hint` string, nullable
    - `style_guide` object
    - `image_overlays` ImageOverlay[]
      - `id` string
      - `resource_id` string, nullable
      - `name` string, nullable
      - `source` string, nullable
      - `data_url` string, nullable
      - `gcs_path` string, nullable
      - `download_url` string, nullable
      - `mime_type` string, nullable
      - `original_width` integer, nullable
      - `original_height` integer, nullable
      - `position` ImageOverlayPosition, required
        - `xPct` number, required
        - `yPct` number, required
        - `widthPct` number, required
        - `heightPct` number, nullable
    - `source_type` string, nullable
    - `billing_key` string, nullable
    - `preservation_manifest` object
    - `lve_mode` boolean
    - `placement_spec` object, nullable
    - `lve_artifacts` object, nullable
  - `footer_reserve_emu` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/slidemaster/apis/slidemaster-ai-api.md) · [All operations](https://skmtc.dev/slidemaster/apis/slidemaster-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/slidemaster/apis/slidemaster-ai-api/revisions/a964c005977e?raw)
