跳转到主要内容
POST
/
kyyAiPower
/
v1
/
sora
/
videos
curl --request POST \
  --url https://zcbservice.aizfw.cn/kyyAiPower/v1/sora/videos \
  --header 'Authorization: Bearer {{key}}' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "sora-2",
    "prompt": "A cat dancing in the rain, cinematic style",
    "aspect_ratio": "16:9",
    "seconds": 10,
    "input_reference": [
      "https://example.com/reference1.jpg",
      "https://example.com/reference2.jpg"
    ]
  }'
{
  "id": "sora_abc123def456",
  "object": "video.generation",
  "created": 1761635478,
  "model": "sora-2",
  "status": "queued"
}

Sora 创建视频任务

使用 Sora 的先进 AI 模型创建高质量视频生成任务,支持多种模型和时长选项。

认证

所有请求都需要在请求头中包含 Bearer token:
Authorization: Bearer {{key}}

请求参数

model
string
必填
模型名称,可选值:
  • sora2 - 支持 10 或 15 秒
  • sora2Stable - 支持 10 或 15 秒
  • sora2Pro - 支持 10 秒 (HD)、 25 秒
  • openAiSora2 - 支持4、8、12
  • openAiSora2Stable - 支持4、8、12
prompt
string
必填
视频生成提示词,描述所需的视频内容示例:"A cat dancing in the rain, cinematic style"
size
string
视频尺寸,默认为 720x1280可选值:
  • 720x1280 - 竖屏
  • 1280x720 - 横屏
aspect_ratio 二选一使用
aspect_ratio
string
视频宽高比可选值:
  • 16:9 - 横屏
  • 9:16 - 竖屏
size 二选一使用
duration
integer
视频时长(秒),支持 10 和 15
seconds 二选一使用
seconds
integer
视频时长(秒),支持 10 和 15
duration 二选一使用
input_reference
array
参考图片数组,用于指导视频生成,最多支持 3 张图片
image_urls 二选一使用
image_urls
array
参考图片URL数组,用于指导视频生成
input_reference 二选一使用

响应参数

id
string
视频生成任务的唯一标识符,用于后续查询任务状态
object
string
对象类型,固定为 video.generation
created
integer
任务创建时间戳
model
string
使用的模型名称
status
string
任务状态:
  • queued - 排队中
  • processing - 处理中
error
string
错误信息,当 status 为 failed 时返回

模型特性

sora-2

标准模型,支持 10 或 15 秒视频生成

sora-2-stable

稳定版模型,支持 10 或 15 秒,更稳定的输出

sora-2-pro

专业版模型,支持 10s (HD)、15s (HD) 或 25s

参数选择规则

参数互斥规则:
  • 尺寸参数sizeaspect_ratio 二选一
  • 时长参数durationseconds 二选一
  • 参考图片input_referenceimage_urls 二选一

视频时长支持

模型支持时长
sora-210 秒、15 秒
sora-2-stable10 秒、15 秒
sora-2-pro10 秒 (HD)、15 秒 (HD)、25 秒
最佳实践:
  1. 视频生成为异步处理,需要通过返回的 id 查询任务状态和结果
  2. 在提示词中明确描述所需的视觉效果和风格
  3. 参考图片可以指导整体风格,最多支持 3 张
  4. 选择合适的宽高比以匹配你的使用场景
提示词建议:
  • 包含具体的场景描述
  • 添加风格关键词(如 “cinematic”, “artistic”, “realistic”)
  • 描述动作和运动方式
  • 指定光照和色彩偏好
curl --request POST \
  --url https://zcbservice.aizfw.cn/kyyAiPower/v1/sora/videos \
  --header 'Authorization: Bearer {{key}}' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "sora-2",
    "prompt": "A cat dancing in the rain, cinematic style",
    "aspect_ratio": "16:9",
    "seconds": 10,
    "input_reference": [
      "https://example.com/reference1.jpg",
      "https://example.com/reference2.jpg"
    ]
  }'
{
  "id": "sora_abc123def456",
  "object": "video.generation",
  "created": 1761635478,
  "model": "sora-2",
  "status": "queued"
}