Sử dụng CometAPI POST /grok/v1/videos/generations để tạo video với Grok, animate một ảnh đầu vào bằng prompt, và thăm dò kết quả qua request_id.
{
"request_id": "4b2cd27e-0b0d-3dec-c31c-7572daf74bb3"
}request_id ngay lập tức, vì vậy hãy xem đây là bước đầu tiên trong một quy trình async.
model: grok-imagine-videoduration ở 1 và resolution ở 480pimage.url khi bạn muốn tạo image-to-videodata:image/png;base64,<BASE64_IMAGE_DATA>Thăm dò đến khi hoàn tất
done.Bearer token authentication. Use your CometAPI key.
Prompt for the video job.
"A candle flickers on a wooden table."
Output aspect ratio.
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 Output duration in seconds. xAI documents a range of 1 to 15 seconds.
Optional source image for image-to-video.
Show child attributes
xAI video model id.
"grok-imagine-video"
Show child attributes
Output resolution.
480p, 720p Deprecated size field. Prefer aspect_ratio and resolution.
Optional end-user identifier.
Request accepted.
Deferred request id used for polling.
{
"request_id": "4b2cd27e-0b0d-3dec-c31c-7572daf74bb3"
}