public-api

Public Render Slides

使用 AI(Gemini Imagen)根據文字描述渲染投影片圖片(非同步)。

為每張投影片的 title + description 生成 16:9 專業簡報圖片, 並將投影片記錄寫入 Firestore。渲染完成後專案狀態變為 parsed。 單次上限 30 張投影片。

必填欄位:project_id(專案 ID)、slides(投影片描述陣列)。 選填:image_size(1K/2K/4K,預設 2K)。

來源閘(MCP only):當 X-Source-Platform = mcp 時,必須附上 user_intent_quote (用戶明確要求渲染/視覺的原話,>=10 字)。用意:避免 MCP 宿主(如 Cowork) 從 design_course_experience 自動鏈接過來渲染——宿主本身有 presentation 能力, 只有在用戶明確要我們做創意視覺 / 智能佈局時才放行。

錯誤:

  • 503:Gemini API 未設定。
  • 404:專案不存在。
  • 403:該專案不屬於目前使用者。
  • 400:未提供投影片描述或超過 30 張上限,或 MCP 來源缺 user_intent_quote。
post/api/v1/public/slides/render

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/slides/render
  • Auth: none declared

Headers

Authorizationstring nullable
X-API-Keystring nullable

Request body

project_idstring required
image_size'1K' | '2K' | '4K' nullable
style_guideobject nullable

風格指南(來自 analyze_style_image 回傳)

dry_runboolean nullable

若為 true,僅回傳預估成本,不實際渲染

user_intent_quotestring nullable

來自 MCP 時必填:用戶明確要求渲染/視覺的原話(>=10 字)。web/直接 API 呼叫可省略。

request_idstring nullable

用戶端重試去重鍵:同一渲染請求重送時帶相同 request_id 可避免重複扣款。新的渲染請求(含對同一張投影片的重渲)不得沿用舊 request_id——創意視覺每次渲染都會收費。省略時伺服器視每個請求為全新渲染。

Response

Successful Response

statusstring required
messagestring required
summarystring
next_suggestionstring

Changes

No recorded changes to this operation across all 1 revision of this API.