استخدم 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.url يمكن الوصول إليهrequest_id المُعاد، لأن عمليات التحرير تستخدم نفس آلية الاستعلام المستخدمة في الإنشاءالاستعلام عن النتيجة النهائية
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"
}