Використовуйте POST /v1/videos, щоб створювати завдання генерації відео Sora 2 з текстових Prompt або референсних зображень, а потім опитувати статус за ID завдання для отримання результатів.
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 для швидшої ітерації або sora-2-pro, коли якість результату важливіша за швидкістьseconds рівним 4size: 1280x720, якщо вам не потрібен саме портретний форматСтворіть завдання рендерингу
model, prompt, seconds і size, а потім збережіть повернений id.Опитуйте, доки завдання не завершиться
completed або failed.Завантажте або переробіть результат
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"
}