สร้างงานสร้างวิดีโอ
ตรวจสอบ input หักเครดิต สร้างงาน และส่งคืน taskId
พารามิเตอร์ Payload
- จำเป็น หนึ่งใน 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
- ตามเงื่อนไข จำเป็นสำหรับทุกโมเดลยกเว้น sora-2-pro-storyboard
- ตามเงื่อนไข Base64 data URL เช่น data:image/png;base64,... จำเป็นสำหรับ image-to-video หากไม่มี imageUrl
- ตามเงื่อนไข URL รูปภาพสาธารณะที่ใช้เมื่อไม่ได้ระบุ imageData
- ตัวเลือก portrait หรือ landscape ค่าเริ่มต้น: landscape
- ตัวเลือก 10, 15 หรือ 25 (storyboard เท่านั้น) ค่าเริ่มต้นแตกต่างกันตามโมเดล
- ตัวเลือก standard หรือ high สำหรับโมเดล Pro text/image เท่านั้น
- ตัวเลือก ลบลายน้ำสำหรับโมเดลที่ไม่ใช่ storyboard ค่าเริ่มต้น: true
- ตามเงื่อนไข จำเป็นสำหรับ sora-2-pro-storyboard อาร์เรย์ของ '{ Scene, duration }'
หมายเหตุ
- imageData มีความสำคัญกว่า imageUrl เมื่อระบุทั้งสองอย่าง
- prompt เป็นตัวเลือกสำหรับ storyboard และไม่ถูกส่งไปยัง provider; ใช้ shots สำหรับเนื้อหา
- nFrames ถูกปรับให้เป็นค่าที่อนุญาตต่อโมเดล
- removeWatermark ค่าเริ่มต้นเป็น true สำหรับโมเดลที่ไม่ใช่ storyboard
- shots ต้องมี Scene (ตัว S ใหญ่) และ duration > 0
ตัวอย่าง request
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
{
"code": 0,
"message": "ok",
"data": {
"taskId": "281e5b0*********************f39b9"
}
}