Gunakan POST /v1/videos untuk membuat task generasi video Sora 2 dari prompt teks atau gambar referensi, lalu lakukan polling status berdasarkan task ID untuk mendapatkan hasil.
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 untuk iterasi yang lebih cepat atau sora-2-pro saat kualitas output lebih penting daripada kecepatanseconds pada 4 untuk permintaan pertama Andasize: 1280x720 kecuali Anda memang membutuhkan output portraitLakukan polling hingga job selesai
completed atau failed.Unduh atau remix hasilnya
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"
}