跳轉到主要內容
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.