跳转到主要内容
POST
https://api.apimart.ai
/
v1
/
videos
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-1-5-pro",
    "prompt": "一只可爱的小猫在阳光下玩耍,毛发蓬松,眼睛明亮",
    "duration": 5,
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "audio": true
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-1-5-pro",
    "prompt": "一只可爱的小猫在阳光下玩耍,毛发蓬松,眼睛明亮",
    "duration": 5,
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "audio": true
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}

认证

Authorization
string
必填
所有接口均需要使用 Bearer Token 进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY

请求参数

model
string
必填
视频生成模型名称支持的模型:
  • doubao-seedance-1-5-pro - 1.5 Pro 版,支持音频生成和多参考图
prompt
string
必填
视频内容描述建议详细描述场景、动作、风格等,以获得更好的生成效果示例:"海边日落,金色阳光洒在海面上,海浪轻轻拍打沙滩"
duration
integer
默认值:"5"
视频时长(秒)支持范围:4 ~ 12默认值:5
aspect_ratio
string
默认值:"16:9"
视频宽高比可选值:
  • 16:9 - 横屏
  • 9:16 - 竖屏
  • 1:1 - 方形
  • 4:3 - 传统比例
  • 3:4 - 竖向传统比例
  • 21:9 - 超宽屏
默认值:16:9
resolution
string
默认值:"720p"
视频分辨率可选值:
  • 480p - 标清
  • 720p - 高清
默认值:720p
1.5 Pro 分辨率限制:1.5 Pro 不支持 1080p 分辨率,最高支持 720p
seed
integer
种子整数,用于控制生成内容的随机性取值范围:-1 ~ 2^32-1 之间的整数
  • 相同的请求下,模型收到不同的 seed 值(如:不指定 seed 值或令 seed 取值为 -1,会使用随机数替代),将生成不同的结果
  • 相同的请求下,模型收到相同的 seed 值,会生成类似的结果,但不保证完全一致
audio
boolean
默认值:"false"
是否生成音频设置为 true 时,视频将包含 AI 生成的配套音频默认值:false
音频生成是 1.5 Pro 的独有功能,1.0 版本不支持此参数
camerafixed
boolean
默认值:"false"
是否固定摄像头设置为 true 时,摄像头位置保持固定默认值:false

分辨率与宽高比组合

分辨率支持的宽高比备注
480p16:9, 4:3, 1:1, 3:4, 9:16, 21:9全部支持
720p16:9, 4:3, 1:1, 3:4, 9:16, 21:9全部支持
image_urls
array
图片 URL 数组,用于图生视频自动分配角色规则:
  • 1张 = 首帧
  • 2张 = 首帧 + 尾帧
  • 3+张 = 首帧 + 尾帧 + 参考图
示例:["https://example.com/first.png", "https://example.com/last.png"]
  • image_urlsimage_with_roles 不能同时使用
image_with_roles
array
带角色的图片数组,支持更精细的控制示例:
[
  {"url": "https://example.com/start.png", "role": "first_frame"},
  {"url": "https://example.com/end.png", "role": "last_frame"},
  {"url": "https://example.com/ref1.png", "role": "reference_image"},
  {"url": "https://example.com/ref2.png", "role": "reference_image"}
]
  • image_urlsimage_with_roles 不能同时使用
  • 首帧和尾帧仅支持各一张
  • 参考图支持 1-4 张,使用 reference_image 角色(注意:1.0 版本使用 reference,1.5 Pro 使用 reference_image

响应

code
integer
响应状态码,成功时为 200
data
array
返回数据数组

使用场景

场景 1:带音频的文生视频

{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "海边日落,金色阳光洒在海面上,海浪轻轻拍打沙滩",
  "audio": true
}

场景 2:高质量竖屏短视频

{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "一位女孩在樱花树下旋转,花瓣随风飘落",
  "duration": 5,
  "aspect_ratio": "9:16",
  "resolution": "720p",
  "audio": true
}

场景 3:基于首帧生成动态视频

{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "让画面动起来,添加自然的动态效果",
  "image_urls": ["https://example.com/first.png"],
  "duration": 5,
  "audio": true
}

场景 4:首尾帧控制的转场效果

{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "画面从白天逐渐过渡到夜晚,城市灯光逐渐亮起",
  "image_with_roles": [
    {"url": "https://example.com/day.png", "role": "first_frame"},
    {"url": "https://example.com/night.png", "role": "last_frame"}
  ],
  "duration": 5
}

场景 5:多参考图风格控制

{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "参考图片风格生成视频,保持一致的视觉效果",
  "audio": true,
  "image_with_roles": [
    {"url": "https://example.com/first.png", "role": "first_frame"},
    {"url": "https://example.com/ref1.png", "role": "reference_image"},
    {"url": "https://example.com/ref2.png", "role": "reference_image"},
    {"url": "https://example.com/ref3.png", "role": "reference_image"}
  ]
}
查询任务结果视频生成为异步任务,提交后会返回 task_id。使用 获取任务状态 接口查询生成进度和结果。

与 1.0 版本的差异

特性1.0 fast/quality1.5 Pro
默认分辨率1080p720p
支持分辨率480p/720p/1080p480p/720p
时长范围2-12秒4-12秒
音频生成不支持支持
参考图角色reference (1张)reference_image (1-4张)