Используйте POST /grok/v1/videos/edits, чтобы редактировать исходное видео с помощью текстового Prompt, сохранять движение и получать request_id для асинхронного опроса результатов.
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.urlrequest_id, потому что для edits используется тот же процесс опроса, что и для generationОтправьте запрос на редактирование
model: grok-imagine-video.Опросите финальный результат
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"
}