Tạo video
Sử dụng CometAPI POST /grok/v1/videos/generations để tạo video với Grok, làm chuyển động một ảnh đầu vào bằng prompt và truy vấn kết quả qua request_id.
Sử dụng endpoint này để khởi tạo một tác vụ video Grok từ văn bản, hoặc từ văn bản cộng với một ảnh nguồn. Endpoint này trả vềDocumentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
request_id ngay lập tức, vì vậy hãy coi đây là bước đầu tiên trong một quy trình async.
Bắt đầu với một yêu cầu nhỏ
- Sử dụng
model: grok-imagine-video - Với yêu cầu đầu tiên, giữ
durationở1vàresolutionở480p - Chỉ thêm
image.urlkhi bạn muốn dùng image-to-video - Nếu bạn gửi base64, hãy giữ nguyên định dạng trong tài liệu và ví dụ OpenAPI là
data:image/png;base64,<BASE64_IMAGE_DATA>
Luồng tác vụ
Truy vấn cho đến khi hoàn tất
done.Ủy quyền
Bearer token authentication. Use your CometAPI key.
Nội dung
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.
xAI video model id.
"grok-imagine-video"
Output resolution.
480p, 720p Deprecated size field. Prefer aspect_ratio and resolution.
Optional end-user identifier.
Phản hồi
Request accepted.
Deferred request id used for polling.