生成源影片
從真實 generate_video 工具生成輸入、輸出、OAuth 權限與安全註解,與經過核實的 MCP 契約保持一致。
本頁目錄
工具
generate_video
建立獨立影片任務;需批准的 quote_id 或 max_credits 及冪等鍵。儲存輸出影片資產 ID。
權限與安全
OAuth 權限:animations:write
| 訊號 | 值 |
|---|---|
destructiveHint |
true |
idempotentHint |
true |
openWorldHint |
true |
readOnlyHint |
false |
| spendsCredits | true |
| requiresUserConfirmation | true |
| sideEffects | generation_started, credits_reserved_or_charged |
註解用於描述安全屬性,不能替代使用者批准、OAuth 授權或服務端校驗。
輸入引數
| 欄位 | 型別 | 必填 | 預設值 | 約束 | 含義 |
|---|---|---|---|---|---|
idempotency_key |
string |
是 | — | minLength: 8; maxLength: 200 |
為這次邏輯影片生成儲存並複用。 |
max_credits |
integer / null |
否 | null |
minimum: 0 |
已批准的單次點數上限。 |
quote_id |
string / null |
否 | null |
format: uuid |
— |
request |
VideoGenerationCreateRequest | 是 | — | — | — |
引數示例
{
"idempotency_key": "example-video-001",
"max_credits": 0,
"request": {
"input": {
"first_frame": {
"file_id": "00000000-0000-4000-8000-000000000001",
"type": "file"
}
},
"prompt": "A character runs in place, side view, fixed camera."
}
}
結構化返回
| 欄位 | 型別 | 必填 | 預設值 | 約束 | 含義 |
|---|---|---|---|---|---|
created_at |
string |
是 | — | format: date-time |
任務被接受的 UTC 時間。 |
credits |
CreditUsage | 是 | — | — | 報價、預佔及已扣點數狀態。 |
error |
TaskError / null |
否 | null |
— | 任務失敗資訊,與是否存在可用產物分別判斷。 |
finished_at |
string / null |
否 | null |
format: date-time |
已知時返回 UTC 終態時間。 |
id |
string |
是 | — | format: uuid |
建立後立即儲存任務 ID,通過它輪詢,不要再次建立。 |
metadata |
object |
否 | {} |
— | 呼叫方提供的後設資料。 |
normalized_input |
object |
否 | {} |
— | 規範化公共輸入,可能含私有提示詞或圖片引用,不要整體寫入日誌。 |
object |
string |
是 | — | enum: "video_generation", "animation_export", "animation" |
公共任務資源型別。 |
outputs |
array<AssetResponse> | 否 | [] |
— | 可用資產,失敗或取消也可能有部分產物;所有終態都應檢查。 |
progress |
number |
是 | — | minimum: 0; maximum: 1 |
0 至 1 的進度值,不代表精確完成時間。 |
resolved_export |
ResolvedExport / null |
否 | null |
— | 持久化的 FPS 取樣摘要,與報價、Manifest 一致;歷史任務為 null。 |
stage |
string / null |
否 | null |
enum: "queued", "video_generation", "animation_export", "completed" |
可用時顯示當前流水線階段。 |
started_at |
string / null |
否 | null |
format: date-time |
已知時返回 UTC 生產開始時間。 |
status |
string |
是 | — | enum: "queued", "running", "cancelling", "succeeded", "failed", "cancelled" |
succeeded、failed、cancelled 為終態;cancelling 不是終態。 |
錯誤與後續步驟
工具錯誤包含 error 物件,內有 code、message、retryable、request_id 和 details。不要依賴訊息文本分支或洩露私有輸入。終態失敗也要檢查部分產物;返回簽名 URL 不代表已儲存檔案。
這篇文件有幫助嗎?
不收集搜尋字詞、程式碼或自由文字。此開關僅控制文件互動事件。 隱私權政策