Tạo tác vụ generation
Xác thực đầu vào, trừ credits, tạo tác vụ và trả về taskId.
Tham số payload
- Bắt buộc. Một trong các giá trị: sora-2-text-to-video, sora-2-image-to-video, sora-2-pro-text-to-video, sora-2-pro-image-to-video, sora-2-pro-storyboard.
- Có điều kiện. Bắt buộc cho tất cả các model ngoại trừ sora-2-pro-storyboard.
- Có điều kiện. Data URL Base64 như data:image/png;base64,... Bắt buộc cho image-to-video nếu không có imageUrl.
- Có điều kiện. URL hình ảnh công khai được sử dụng khi imageData không được cung cấp.
- Tùy chọn. portrait hoặc landscape. Mặc định: landscape.
- Tùy chọn. 10, 15, hoặc 25 (chỉ storyboard). Mặc định thay đổi theo model.
- Tùy chọn. standard hoặc high. Chỉ cho các model Pro text/image.
- Tùy chọn. Xóa watermark cho các model không phải storyboard. Mặc định: true.
- Có điều kiện. Bắt buộc cho sora-2-pro-storyboard. Mảng các '{ Scene, duration }'.
Ghi chú
- imageData được ưu tiên hơn imageUrl khi cả hai đều được cung cấp.
- prompt là tùy chọn cho storyboard và không được gửi đến provider; sử dụng shots cho nội dung.
- nFrames được chuẩn hóa theo các giá trị cho phép của từng model.
- removeWatermark mặc định là true cho các model không phải storyboard.
- shots phải bao gồm Scene (chữ S viết hoa) và duration > 0.
Request mẫu
curl -X POST https://freesoragenerator.com/api/v1/video/sora-pro \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2-pro-text-to-video",
"prompt": "A cinematic shot of a futuristic city at sunset.",
"aspectRatio": "landscape",
"nFrames": "10",
"size": "high",
"removeWatermark": true
}'curl -X POST https://freesoragenerator.com/api/v1/video/sora-pro \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2-image-to-video",
"prompt": "Turn this image into a dynamic 10s clip.",
"imageUrl": "https://example.com/reference.png",
"aspectRatio": "portrait",
"nFrames": "10"
}'curl -X POST https://freesoragenerator.com/api/v1/video/sora-pro \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2-pro-storyboard",
"shots": [
{ "Scene": "Establishing shot of a city skyline at dusk", "duration": 5 },
{ "Scene": "Close-up of a runner splashing through puddles", "duration": 5 }
],
"aspectRatio": "landscape",
"nFrames": "10"
}'Response mẫu
{
"code": 0,
"message": "ok",
"data": {
"taskId": "281e5b0*********************f39b9"
}
}