创建生成任务
校验参数、扣减积分、创建任务并返回 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: 条件必填。Base64 Data URL,如 data:image/png;base64,...。无 imageUrl 时图生模型必填。
- imageUrl: 条件必填。公开图片 URL,仅在未提供 imageData 时使用。
- aspectRatio: 可选。portrait 或 landscape,默认 landscape。
- nFrames: 可选。多数模型 10/15;分镜支持 10/15/25。不同模型默认值不同。
- size: 可选。standard 或 high,仅 Pro 文生/图生有效。
- removeWatermark: 可选。非分镜且非 stable 模型可去水印,默认 true。
- isPublic: 选填。是否公开显示视频;默认为 true。设置为 false 需 VIP。
- shots: 条件必填。sora-2-pro-storyboard 需要,数组元素为 '{ Scene, duration }'。
说明
- 同时提供时 imageData 优先于 imageUrl。
- 分镜模式 prompt 可选,不会传给上游;请用 shots 描述内容。
- nFrames 会归一化到各模型允许值。
- 非分镜且非 stable 模型 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,
"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"
}
}