xAI
获取 xAI 视频结果
使用 GET /grok/v1/videos/ 轮询 xAI 视频生成状态,并在处理完成后获取最终视频 URL。
GET
cURL
在已获取
request_id 后使用此端点。它会告知 xAI 任务是否仍在运行,并在准备就绪后返回最终视频元数据。
首先检查这些字段
request_id任务已被接受但结果尚未就绪时status用于查看 xAI 任务状态;当其为pending时继续轮询,并在done、failed或expired时停止progress在返回时用于查看完成百分比video.url渲染完成时
轮询循环
1
先创建或编辑视频
先从 创建 xAI 视频 或 创建 xAI 视频编辑,然后复制返回的
request_id。2
轮询直到任务达到终止状态
如果响应仅回显
request_id,请等待几秒后再次轮询。当 status 为 pending 时继续;在 done、failed 或 expired 时停止。3
保存已完成的文件
请及时下载或复制最终的
video.url,因为 xAI 将生成的 URL 标记为临时 URL。授权
Use your CometAPI API key as the bearer value.
路径参数
The deferred request ID returned by the create or edit endpoint.
响应
200 - application/json
The current Grok video task state.
Returned when the request is accepted but result metadata is not ready yet.
The Grok video model ID.
Generated video metadata. Present when the job has completed.
The job state. done means the video metadata is ready.
可用选项:
pending, done, failed, expired Completion percentage when returned.
Additional usage metadata returned when the job is complete. Its contents can vary by model.
Error details when the job fails.
最后修改于 2026年8月21日