إنشاء مهمة توليد
التحقق من صحة الإدخال، وخصم الرصيد، وإنشاء مهمة، وإرجاع taskId.
معلمات الحمولة
- model: مطلوب. أحد: sora-2-text-to-video، sora-2-image-to-video، sora-2-text-to-video-stable، sora-2-image-to-video-stable، sora-2-pro-text-to-video، sora-2-pro-image-to-video، sora-2-pro-storyboard.
- prompt: شرطي. مطلوب لجميع النماذج باستثناء sora-2-pro-storyboard.
- imageData: شرطي. عنوان URL لبيانات Base64 مثل data:image/png;base64,... مطلوب لتحويل الصورة إلى فيديو إذا لم يكن هناك imageUrl.
- imageUrl: شرطي. عنوان URL للصورة العامة يُستخدم عندما لا يتم توفير imageData.
- aspectRatio: اختياري. portrait أو landscape. الافتراضي: landscape.
- nFrames: اختياري. 10 أو 15 أو 25 (لوحة القصة فقط). تختلف الافتراضيات حسب النموذج.
- size: اختياري. standard أو high. فقط لنماذج Pro نص/صورة.
- removeWatermark: اختياري. إزالة العلامة المائية للنماذج غير لوحة القصة. الافتراضي: true.
- isPublic: اختياري. ما إذا كان سيتم عرض الفيديو علنًا؛ الافتراضي هو true.
- shots: شرطي. مطلوب لـ sora-2-pro-storyboard. مصفوفة من '{ Scene, duration }'.
ملاحظات
- imageData له الأولوية على imageUrl عند توفير كليهما.
- prompt اختياري للوحة القصة ولا يُرسل إلى المزود؛ استخدم shots للمحتوى.
- يتم تطبيع nFrames إلى القيم المسموح بها لكل نموذج.
- removeWatermark افتراضيًا true للنماذج غير لوحة القصة.
- يجب أن تتضمن shots حقل Scene (بحرف S كبير) ومدة > 0.
طلبات نموذجية
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,
"isPublic": 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-stable",
"prompt": "Turn this image into a dynamic 15s clip.",
"imageData": "data:image/png;base64,iVBORw0KGgoAAA...",
"aspectRatio": "portrait",
"nFrames": "15"
}'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"
}'استجابة نموذجية
{
"code": 0,
"message": "ok",
"data": {
"taskId": "281e5b0*********************f39b9"
}
}