---
title: "Public Batch Generate Scripts"
method: POST
path: "/api/v1/public/scripts/batch-generate"
tags: ["public-api"]
---

# Public Batch Generate Scripts

`POST /api/v1/public/scripts/batch-generate`

## 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/public/scripts/batch-generate`
- Auth: none declared

為專案中所有（或指定）投影片批量觸發 AI 講稿生成（非同步）。

若未指定 slide_ids，則對專案內所有投影片生成講稿。傳統型專案優先使用
batch_generate_script 任務以確保上下文連貫。回傳 202 Accepted。

必填欄位：project_id（專案 ID）。
選填：slide_ids（指定投影片清單）、prompt_style（講稿風格）、regenerate（覆寫既有）。

錯誤：
- 404：專案不存在。
- 403：該專案不屬於目前使用者。
- 400：沒有找到需要生成講稿的投影片。

## Headers

- `Authorization` string, nullable
- `X-API-Key` string, nullable

## Request body

- PublicScriptBatchGenerateRequest
  - `project_id` string, required
  - `prompt_style` 'professional' | 'casual' | 'educational' | 'storytelling', nullable
  - `regenerate` boolean, nullable
  - `slide_ids` string[], nullable
  - `language` 'zh-TW' | 'zh-CN' | 'en' | 'ja', nullable

## Response `202`

Successful Response

- PublicTaskResponse
  - `status` string, required
  - `message` string, required
  - `summary` string
  - `next_suggestion` string

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