Skip to main content
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>'
{
  "code": "success",
  "message": "",
  "data": {
    "task_id": "4b2cd27e-0b0d-3dec-c31c-7572daf74bb3",
    "action": "VIDEO_GENERATION",
    "status": "SUCCESS",
    "fail_reason": "https://vidgen.x.ai/xai-vidgen-bucket/xai-video-72924fdc-e6d7-4885-b318-8a367aaa9a02.mp4",
    "submit_time": 1773297002,
    "start_time": 0,
    "finish_time": 1773297014,
    "progress": "100%",
    "data": {
      "model": "grok-imagine-video",
      "usage": {
        "cost_in_usd_ticks": 500000000
      },
      "video": {
        "url": "https://vidgen.x.ai/xai-vidgen-bucket/xai-video-72924fdc-e6d7-4885-b318-8a367aaa9a02.mp4",
        "duration": 1,
        "respect_moderation": true
      },
      "status": "done"
    }
  }
}
Use this endpoint after you already have a request_id. It tells you whether the xAI job is still running and returns the final video metadata when ready.

Check these fields first

  • Wrapper code and message for top-level errors
  • data.status for the CometAPI task state
  • data.data.status for the nested provider state
  • data.data.video.url when the render is complete

Polling loop

1

Create or edit the video first

Start with Video Generation or Video Edit, then copy the returned request_id.
2

Keep polling until the nested status is done

Check both the wrapper and nested provider fields so you can distinguish wrapper failures from provider-level failures.
3

Persist the finished file

Download or copy the final video.url promptly, because xAI documents generated URLs as temporary.

What to expect on CometAPI

This is still the same poll step that xAI describes in its official workflow. CometAPI adds a wrapper envelope around the provider payload so you can handle async jobs more consistently across providers.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Path Parameters

request_id
string
required

Deferred request id returned by the create or edit endpoint.

Response

200 - application/json

Current task state.

code
string
required
message
string
required
data
object
required