取消一鍵動畫
從原始碼生成 POST /animations/{animation_id}/cancel 的鑑權、欄位、響應、錯誤與安全呼叫參考。
本頁目錄
操作
POST /animations/{animation_id}/cancel
operationId: cancel_one_click_animation_v1_animations__animation_id__cancel_post
盡力取消所屬任務,返回仍可能是非終態,應繼續輪詢。已完成工作可能保留扣費,未消耗預佔可釋放,先前產物可能保留;不保證全額退款。
鑑權與副作用
使用可信環境中的 Bearer API Key。所需權限:animations:write
此操作不啟動付費生成,其他狀態變化見上文說明。
引數
| 引數 | 位置 | 型別 | 必填 | 約束 / 預設值 | 含義 |
|---|---|---|---|---|---|
animation_id |
path |
string |
是 | format: uuid |
所屬公共資源 UUID;任務、資產、檔案 ID 不能互換。 |
響應
| HTTP | 正文 | 含義 |
|---|---|---|
200 |
TaskResponse | 成功的公開響應,示例數值僅用於說明。 |
400 |
APIErrorEnvelope | 輸入錯誤,修正請求後再嘗試。 |
401 |
APIErrorEnvelope | API Key 缺失、到期或被撤銷。 |
403 |
APIErrorEnvelope | 帳戶資格、帳戶狀態或 Key 權限不允許此操作。 |
404 |
APIErrorEnvelope | 資源不可用、不屬於當前使用者,或簽名無效/過期。 |
429 |
APIErrorEnvelope | 觸發帳戶級速率或佇列限制,遵循 Retry-After 等待。 |
500 |
APIErrorEnvelope | 內部錯誤,保留任務 ID 和冪等鍵,僅標記可重試時重試。 |
503 |
APIErrorEnvelope | 服務或供應商不可用,僅 error.retryable 為 true 時重試。 |
響應頭
| HTTP | 響應頭 | 型別 | 含義 |
|---|---|---|---|
429 |
Retry-After |
integer |
建議等待秒數,遵循服務值並設定總體截止時間。 |
503 |
Retry-After |
integer |
建議等待秒數,遵循服務值並設定總體截止時間。 |
響應示例
{
"created_at": "2026-08-30T00:00:00Z",
"credits": {
"charged": 0,
"held": 1,
"quoted": 1
},
"error": null,
"finished_at": null,
"id": "00000000-0000-4000-8000-000000000002",
"metadata": {},
"normalized_input": {},
"object": "animation",
"outputs": [],
"progress": 0,
"stage": "queued",
"started_at": null,
"status": "cancelling"
}
相關教程
這篇文件有幫助嗎?
不收集搜尋字詞、程式碼或自由文字。此開關僅控制文件互動事件。 隱私權政策