สร้างวิดีโอ AI
เริ่มต้นงานสร้างวิดีโอ AI ด้วยข้อความแจ้งจากข้อความหรือรูปภาพ
พารามิเตอร์ข้อมูล
- model: จำเป็น ต้องใช้รุ่นที่รองรับจากข้อมูลอ้างอิง API เพื่อกำหนดเป้าหมายรุ่นที่คุณต้องการ
- prompt: จำเป็น คำอธิบายฉากที่คุณต้องการสร้างด้วยภาษาธรรมชาติ
- imageData: ไม่บังคับ (แนะนำ) URL ข้อมูล Base64 พร้อมคำนำหน้า "data:image/*;base64," สำหรับโหมดภาพเป็นวิดีโอ
- url: Optional. Legacy reference image URL; still supported but lower priority than imageData.
- aspectRatio: ไม่บังคับ ค่าที่รองรับ: "9:16" (ค่าเริ่มต้น) หรือ "16:9"
- duration: Optional. Only for "sora-2-stable"; choose 10 or 15 seconds (default 10).
- isPublic: ไม่บังคับ แสดงวิดีโอต่อสาธารณะหรือไม่ ค่าเริ่มต้นคือ true
- remixTargetId: ไม่บังคับ (VIP เท่านั้น) pid วิดีโอเป้าหมายสำหรับคุณสมบัติต่อเนื่อง/รีมิกซ์
- characters: ไม่บังคับ (VIP เท่านั้น) อาร์เรย์ควบคุมตัวละคร แต่ละรายการรวม url และ timestamps
หมายเหตุ
- การตอบกลับจะถูกส่งกลับทันทีพร้อม taskId; ตรวจสอบ check-result จนกว่าสถานะจะสำเร็จหรือล้มเหลว
ตัวอย่างคำขอ
curl -X POST https://freesoragenerator.com/api/v1/video/sora-video \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2-stable",
"prompt": "A cinematic shot of a futuristic city at sunset, captured in 4K.",
"imageData": "data:image/png;base64,iVBORw0KGgoAAA...",
"aspectRatio": "9:16",
"duration": 15,
"isPublic": true
}'ตัวอย่างการตอบกลับ
{
"code": 0,
"message": "ok",
"data": {
"id": "task_1234567890"
}
}