Sử dụng POST /grok/v1/videos/edits để chỉnh sửa một video nguồn bằng text prompt, giữ nguyên chuyển động và nhận request_id để polling kết quả bất đồng bộ.
curl --request POST \
--url https://api.cometapi.com/grok/v1/videos/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Add snow to the scene.",
"video": {
"url": "https://example.com/source.mp4"
}
}
'{
"request_id": "e55813f7-911f-cfa8-208c-9c8e693b4d38"
}video.url có thể truy cập đượcrequest_id được trả về, vì chỉnh sửa sử dụng cùng luồng polling như quá trình tạoPolling kết quả cuối cùng
Bearer token authentication. Use your CometAPI key.
Edit instruction describing the change you want.
"Add snow to the scene."
Source video to edit. xAI documents an input limit of about 8.7 seconds.
Show child attributes
xAI video model id.
"grok-imagine-video"
Optional output delivery configuration.
Optional end-user identifier.
Request accepted.
Deferred request id used for polling.
curl --request POST \
--url https://api.cometapi.com/grok/v1/videos/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Add snow to the scene.",
"video": {
"url": "https://example.com/source.mp4"
}
}
'{
"request_id": "e55813f7-911f-cfa8-208c-9c8e693b4d38"
}