建立生成任務
驗證輸入、扣除點數、建立任務並回傳 taskId。
請求參數
- 必填。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 資料 URL,如 data:image/png;base64,...。若無 imageUrl,圖片轉影片需要此欄位。
- 條件必填。當未提供 imageData 時使用的公開圖片 URL。
- 選填。portrait 或 landscape。預設:landscape。
- 選填。10、15 或 25(僅限分鏡腳本)。預設值因模型而異。
- 選填。standard 或 high。僅適用於 Pro 文字/圖片模型。
- 選填。移除非分鏡腳本模型的浮水印。預設:true。
- 條件必填。sora-2-pro-storyboard 需要。'{ Scene, duration }' 的陣列。
備註
- 當同時提供 imageData 和 imageUrl 時,imageData 優先。
- prompt 對於分鏡腳本是選填的,不會傳送給供應商;請使用 shots 提供內容。
- nFrames 會根據每個模型的允許值進行標準化。
- 非分鏡腳本模型的 removeWatermark 預設為 true。
- shots 必須包含 Scene(大寫 S)且 duration > 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
}'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"
}'回應範例
{
"code": 0,
"message": "ok",
"data": {
"taskId": "281e5b0*********************f39b9"
}
}