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

# Public Generate Tts

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

為投影片生成 TTS 語音配音（非同步）。

可指定 project_id（整個專案所有投影片配音）或 slide_id（單張配音），至少擇一。
配音完成後音檔會自動附加到投影片記錄中。

選填：tts_provider（gemini/azure/cosyvoice）、voice_name（語音名稱，
可從 GET /voices 取得）、speaking_rate（語速，預設 1.0）。

錯誤：
- 422：未提供 project_id 或 slide_id（至少擇一）。
- 404：專案或投影片不存在。
- 403：該專案不屬於目前使用者。

## Headers

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

## Request body

- PublicTTSGenerateRequest
  - `project_id` string, nullable
  - `slide_id` string, nullable
  - `tts_provider` 'gemini' | 'cosyvoice' | 'azure', nullable
  - `voice_name` string, nullable
  - `speaking_rate` number, nullable
  - `force_regenerate` 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)
