创建 Sora 2 视频
支持文本转视频与图生视频,可选 Sora 2、Sora Pro 或 Sora 2 Stable 模型,触发新的生成任务。
参数说明
- model: 必填。可选 "sora-2"、"sora-2-pro" 或 "sora-2-stable",按需求选择模型。
- prompt: 必填。用自然语言描述你想要的画面。
- imageData: 选填(推荐)。图生视频模式下的 base64 图像 Data URL,需带前缀 "data:image/*;base64,"。
- url: 选填。传统的参考图片 URL;仍支持但优先级低于 imageData。
- aspectRatio: 选填。支持 "9:16"(默认)或 "16:9"。
- duration: 选填。仅用于 "sora-2-stable",可选 10 或 15 秒,默认 10。
- isPublic: 选填。是否公开显示视频;默认为 true。
- remixTargetId: 选填(VIP 专属)。用于续写/混剪功能的目标视频 pid。
- characters: 选填(VIP 专属)。角色控制数组;每项包含 url 和 timestamps。
使用提示
- 接口会立即返回 taskId;调用 check-result 轮询,直到状态变为 succeeded 或 failed。
请求示例
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"
}
}