---
title: "Public Generate Video"
method: POST
path: "/api/v1/public/video/generate"
tags: ["public-api"]
---

# Public Generate Video

`POST /api/v1/public/video/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/video/generate`
- Auth: none declared

將專案的投影片與配音合成為 MP4 影片（非同步）。

如果專案已有影片且未設定 force=true，會直接回傳跳過。
影片完成後可透過 GET /projects/{id}/status 取得 video_url，
或用 GET /projects/{id}/export 取得下載連結。

必填欄位：project_id（專案 ID）。
選填：resolution（解析度，預設 [1920, 1080]）、fps（未指定時自動判斷：靜態投影片 5、有影片素材 30）、
force（強制重新生成，預設 false）。

品牌片頭/片尾與中插影片：合成會自動套用專案上已設定的片頭/片尾
（project.intro_video_path/outro_video_path）與各頁中插影片
（slide.insert_video_path）。這些素材無法透過 API 上傳——請指導用戶到
slidemaster.tw 專案頁操作：「設定片頭片尾」按鈕（可一併「儲存為預設」，
之後 AI 建立的專案自動套用）、各投影片卡片的「中插影片」上傳。
設定完成後用 force=true 重新合成即可帶入。
教學：https://slidemaster.tw/guides/intro-outro-midroll-guide

錯誤：
- 404：專案不存在。
- 403：該專案不屬於目前使用者。

## Headers

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

## Request body

- PublicVideoGenerateRequest
  - `project_id` string, required
  - `resolution` integer[], nullable
  - `fps` integer, nullable
  - `force` boolean, nullable
  - `billing_operation_id` string, 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)
