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

先检查这些字段

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

轮询循环

1

先创建或编辑视频

先从 创建 xAI 视频创建 xAI 视频编辑 开始,然后复制返回的 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

Billing metadata. cost_in_usd_ticks reports the cost in provider ticks.

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.