Sử dụng POST /v1/videos để tạo tác vụ sinh video Sora 2 từ prompt văn bản hoặc hình ảnh tham chiếu, sau đó truy vấn trạng thái theo ID tác vụ để lấy kết quả.
curl --request POST \
--url https://api.cometapi.com/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'prompt=A paper airplane glides across a desk.' \
--form input_reference='@example-file'{
"created_at": 1773296991,
"id": "video_69b25d5f467c81908733a56bc236b4df",
"model": "sora-2",
"object": "video",
"progress": 0,
"seconds": "4",
"size": "1280x720",
"status": "queued"
}sora-2 để lặp thử nhanh hơn hoặc sora-2-pro khi chất lượng đầu ra quan trọng hơn tốc độseconds ở 4 cho yêu cầu đầu tiên của bạnsize: 1280x720 trừ khi bạn thực sự cần đầu ra theo chiều dọcTruy vấn cho đến khi tác vụ hoàn tất
completed hoặc failed.Tải xuống hoặc remix kết quả
Bearer token authentication. Use your CometAPI key.
Text prompt that describes the video you want to create.
"A paper airplane glides across a desk."
Sora model ID. Choose a current model from the Models page.
"sora-2"
Clip duration in seconds.
4, 8, 12 "4"
Output resolution formatted as width x height.
720x1280, 1280x720, 1024x1792, 1792x1024 "1280x720"
Optional reference image uploaded as a file. The image should match the target size you request.
curl --request POST \
--url https://api.cometapi.com/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'prompt=A paper airplane glides across a desk.' \
--form input_reference='@example-file'{
"created_at": 1773296991,
"id": "video_69b25d5f467c81908733a56bc236b4df",
"model": "sora-2",
"object": "video",
"progress": 0,
"seconds": "4",
"size": "1280x720",
"status": "queued"
}