xAI
影片編輯
使用 POST /grok/v1/videos/edits 搭配文字 Prompt 編輯來源影片、保留動作,並取得可用於非同步輪詢結果的 request_id。
POST
Create an xAI video edit job
使用這個端點可透過文字指令編輯現有的 MP4。相較於全新生成請求,輸出結果會更貼近來源片段的時間節奏與構圖。Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
傳送請求前
- 提供可存取的
video.url - 讓來源片段保持精簡;依 xAI 官方指引,編輯長度上限約為 8.7 秒
- 使用聚焦的指令,明確描述單一變更
- 保存回傳的
request_id,因為編輯與生成使用相同的輪詢流程
編輯流程
輪詢最終結果
呼叫 取得影片生成結果 直到工作完成。
CometAPI 上有哪些變化
xAI 將影片編輯說明為與生成相同的非同步生命週期,只是以來源影片取代可選的來源圖片。CometAPI 保留這項行為與相同的輪詢端點,因此你的編輯工作流程仍然是開始 -> 輪詢 -> 下載。授權
Bearer token authentication. Use your CometAPI key.
主體
application/json
Edit instruction describing the change you want.
範例:
"Add snow to the scene."
Source video to edit. xAI documents an input limit of about 8.7 seconds.
xAI video model id.
範例:
"grok-imagine-video"
Optional output delivery configuration.
Optional end-user identifier.
回應
200 - application/json
Request accepted.
Deferred request id used for polling.