Mangogo 营业厅Mangogo 营业厅
首页API 参考Skills插件

POST /v1/videos

POST/v1/videos

创建视频任务。

鉴权:Bearer Token

Content-Type:application/json 或 multipart/form-data

请求体(JSON)

{  "model": "sora-2",  "prompt": "A cinematic shot of a cat walking on the beach at sunset, soft ocean waves, warm golden lighting",  "size": "1280x720",  "seconds": 8}

请求字段

字段类型必填说明
modelstring是视频模型名
promptstring是视频描述(≤ 2500 字符)
sizestring条件分辨率,如 1280x720、720x1280;sora-2 等模型必填
secondsint / string条件时长(秒);sora-2 允许 4/8/12/16/20
input_referenceobject / file否参考图

带参考图(JSON URL):

{  "model": "sora-2",  "prompt": "动态化这张图,轻微镜头移动",  "size": "1280x720",  "seconds": 8,  "input_reference": {    "image_url": "https://example.com/ref.jpg"  }}

带参考图(Base64 data URI):

{  "model": "sora-2",  "prompt": "动态化这张图,轻微镜头移动",  "size": "1280x720",  "seconds": 8,  "input_reference": {    "image_url": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."  }}

multipart/form-data:input_reference 为 file 类型表单字段,其余字段同名。

请求示例(curl)

JSON:

curl https://www.yunsell.com/v1/videos \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "model": "sora-2",    "prompt": "A cinematic shot of a cat walking on the beach at sunset, soft ocean waves, warm golden lighting",    "size": "1280x720",    "seconds": 8  }'

带参考图(JSON):

curl https://www.yunsell.com/v1/videos \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "model": "sora-2",    "prompt": "动态化这张图,轻微镜头移动",    "size": "1280x720",    "seconds": 8,    "input_reference": {      "image_url": "https://example.com/ref.jpg"    }  }'

multipart/form-data(上传参考图):

curl https://www.yunsell.com/v1/videos \  -H "Authorization: Bearer sk-xxx" \  -F "model=sora-2" \  -F "prompt=动态化这张图,轻微镜头移动" \  -F "size=1280x720" \  -F "seconds=8" \  -F "input_reference=@/path/to/ref.jpg"

响应体

HTTP 200

{  "id": "task_abc123xyz",  "status": "queued",  "progress": 0,  "created_at": 1712697600}

响应字段

字段类型说明
idstring任务 ID,用于查询和下载
statusstring初始为 queued
progressinteger进度 0–100
created_atintegerUnix 时间戳(秒)

失败响应

HTTP 400

{  "code": "invalid_request",  "message": "seconds must be one of 4, 8, 12, 16, 20"}
字段类型说明
codestring错误码
messagestring校验失败原因

错误格式说明见 任务类错误。