创建 AI 视频
使用文本到视频或图像到视频提示启动 AI 视频生成任务。
参数说明
- model: 必需。使用 API 参考中支持的模型字符串来定位您需要的模型变体。
- prompt: 必需。您想创建的场景的自然语言描述。
- imageData: 选填(推荐)。图生视频模式下的 base64 图像 Data URL,需带前缀 "data:image/*;base64,"。
- url: Optional. Legacy reference image URL; still supported but lower priority than 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"
}
}