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.