Gebruik GET /grok/v1/videos/ om de status van xAI-videogeneratie op te vragen en de uiteindelijke video-URL op te halen zodra de verwerking is voltooid.
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"
}
}
}request_id hebt. Het vertelt je of de xAI-taak nog steeds actief is en retourneert de uiteindelijke videometadata zodra die klaar is.
code en message voor fouten op het hoogste niveaudata.status voor de status van de CometAPI-taakdata.data.status voor de geneste providerstatusdata.data.video.url wanneer de rendering is voltooidMaak of bewerk eerst de video
request_id.Blijf pollen totdat de geneste status done is
Bearer token authentication. Use your CometAPI key.
Deferred request id returned by the create or edit endpoint.
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"
}
}
}