跳转到主要内容
POST
/
v1
/
tasks
Sora 2 系列
curl --request POST \
  --url https://www.qingbo.dev/v1/tasks \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "duration": 123,
  "resolution": "<string>",
  "aspect_ratio": "<string>",
  "seed": 123,
  "image_urls": [
    "<string>"
  ],
  "callback_url": "<string>",
  "callback_events": [
    "<string>"
  ]
}
'
import requests

url = "https://www.qingbo.dev/v1/tasks"

payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"image_urls": ["<string>"],
"callback_url": "<string>",
"callback_events": ["<string>"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
duration: 123,
resolution: '<string>',
aspect_ratio: '<string>',
seed: 123,
image_urls: ['<string>'],
callback_url: '<string>',
callback_events: ['<string>']
})
};

fetch('https://www.qingbo.dev/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.qingbo.dev/v1/tasks"

payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"image_urls\": [\n \"<string>\"\n ],\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"image_urls\": [\n \"<string>\"\n ],\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")
.asString();
{
  "task_id": "task-wave1775285160b950328499",
  "model": "sora-2",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
OpenAI Sora 2 系列视频生成模型,以 物理一致性 / 原生音画同步 / 镜头语言 见长,适合 电影感短片 / 创意广告 / 概念演示 三类场景。支持文生视频与图生视频(单图作起始画面),异步出图。 三档定位:
  • sora-2 — 标准档,日常默认首选,仅 720p,文生 / 图生通吃,性价比最高
  • sora-2-pro — 旗舰档,支持 720p / 1024p / 1080p 三档分辨率,画质最强,单价最高
  • sora-2-preview — 预览档,能力与价格同标准档 sora-2 对齐,用于尝鲜 / 灰度
分辨率 × 时长 计费,每秒单价,时长仅支持 4 / 8 / 12 / 16 / 20 秒固定档位。

定价

模型720p1024p1080p
sora-2$0.09 / 秒
sora-2-preview$0.09 / 秒
sora-2-pro$0.27 / 秒$0.45 / 秒$0.63 / 秒
价为售价(USD)。按秒计费 = 单价/秒 × duration。例:sora-2-pro 1080p 8 秒 = $0.63 × 8 = $5.04

调用示例

curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "prompt": "瀑布飞泻而下,水雾中升起一道彩虹,电影感光影",
    "duration": 8,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "prompt": "镜头缓缓推近,人物迎风转身",
    "image_urls": ["https://cdn.example.com/portrait.jpg"],
    "duration": 8,
    "resolution": "720p"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2-pro",
    "prompt": "黄昏的海滩,女孩迎着夕阳奔跑,长发飞扬,海浪声与脚步声同步",
    "duration": 12,
    "resolution": "1080p",
    "aspect_ratio": "16:9"
  }'
{
  "task_id": "task-wave1775285160b950328499",
  "model": "sora-2",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
提交后用 GET /v1/tasks/{task_id} 轮询状态,详见 任务系统

可用模型

模型 ID分辨率时长支持 action备注
sora-2720p4 / 8 / 12 / 16 / 20 秒generate标准档,日常首选
sora-2-pro720p / 1024p / 1080p4 / 8 / 12 / 16 / 20 秒generate旗舰档,画质最强
sora-2-preview720p4 / 8 / 12 / 16 / 20 秒generate预览档,价格同标准档

通用参数

model
string
必填
模型 ID,见 可用模型
prompt
string
必填
视频描述文本,建议描述 场景 / 主体 / 动作 / 镜头 / 氛围
duration
integer
默认值:"4"
视频时长(秒),仅支持固定档位:4 / 8 / 12 / 16 / 20
resolution
string
默认值:"720p"
输出分辨率。sora-2 / sora-2-preview 仅支持 720p;sora-2-pro 支持 720p / 1024p / 1080p
aspect_ratio
string
默认值:"16:9"
画面宽高比,可选值:
  • 16:9 — 横版宽屏
  • 9:16 — 竖版长屏
  • 1:1 — 正方形
image_urls(图生视频)时,aspect_ratio 被忽略,方向由参考图自动决定。
seed
integer
随机种子,相同 prompt + seed 可复现相似结果
image_urls
string[]
参考图片 URL 数组,用于图生视频。最多 1 张,不传则为文生视频。需公网可下载链接
callback_url
string
Webhook 回调地址,任务终态时调用。详见 回调机制
callback_events
string[]
订阅的回调事件,默认订阅终态(succeeded / failed / cancelled)

模型特定参数

Sora 2 系列无模型特定参数,所有可选项均在 通用参数 中。

资源限制

项目限制
参考图片最多 1 张,单张 ≤ 10MB,JPG / PNG / WEBP
Prompt 长度建议 ≤ 2000 字符
视频时长4 / 8 / 12 / 16 / 20 秒固定档位
分辨率sora-2 / preview 仅 720p;pro 支持 720p / 1024p / 1080p
输出MP4,链接 24 小时有效

相关文档