跳转到主要内容
GET
/
grok
/
v1
/
videos
/
{request_id}
Query an xAI video job
curl --request GET \
  --url https://api.cometapi.com/grok/v1/videos/{request_id} \
  --header 'Authorization: Bearer <token>'
{
  "request_id": "f5f35814-953e-b094-5a2c-4a90014a58cb"
}

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.

在你已经拿到 request_id 之后,使用此端点。它会告诉你 xAI 任务是否仍在运行,并在结果就绪时返回最终视频元数据。

先检查这些字段

  • 当任务已被接受但结果尚未准备好时,查看 request_id
  • status 查看 xAI 任务状态;持续轮询直到它达到 done
  • 当返回 progress 时,用它查看完成百分比
  • 当渲染完成时,查看 video.url

轮询循环

1

先创建或编辑视频

先从视频生成视频编辑开始,然后复制返回的 request_id
2

持续轮询直到 status 为 done

如果响应只回显 request_id,请等待几秒后再次轮询。一旦出现 status,就将其作为停止条件。
3

保存已完成的文件

及时下载或复制最终的 video.url,因为 xAI 文档说明生成的 URL 是临时的。

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

路径参数

request_id
string
必填

Deferred request id returned by the create or edit endpoint.

响应

200 - application/json

Current xAI video task state.

request_id
string

Returned when the request is accepted but result metadata is not ready yet.

model
string

xAI video model id.

usage
object
video
object

Generated video metadata. Present when the job has completed.

status
enum<string>

xAI job state. done means the video metadata is ready.

可用选项:
queued,
processing,
done,
failed,
expired
progress
integer

Completion percentage when returned.

error

Error details when the job fails.