Skip to content

Seedance 2.0 折扣版 API

概览

BaseURL:

baseUrl
https://apifaro.com

支持的模型:

  • doubao-seedance-2.0-discount

身份验证

http
Authorization: Bearer YOUR_GATEWAY_API_KEY
Content-Type: application/json

创建视频

协议

http
POST /v1/videos

示例:

json
{
  "model": "doubao-seedance-2.0-discount",
  "prompt": "A cinematic view of a city at sunset",
  "duration": 5,
  "resolution": "720p",
  "aspect_ratio": "16:9",
  "generate_audio": true,
  "watermark": false
}

请求参数

以下参数由插件的视频解码器支持:

参数类型必填描述
modelstring此渠道必须使用 doubao-seedance-2.0-discount
promptstring文本提示词。使用 Responses 时也可以改用 input
durationinteger视频时长,单位为秒,范围为 415;默认为 5
resolutionstring480p720p1080p
aspect_ratiostring16:99:161:14:33:421:9adaptive
seedinteger随机种子,必须大于或等于 -1
reference_imagesstring[]最多 9 个参考图片 URL
reference_videosstring[]最多 3 个参考视频 URL
reference_audiosstring[]最多 3 个参考音频 URL;需要同时提供参考图片或视频
first_imagestring[]最多 1 个首帧图片 URL
last_imagestring[]最多 1 个末帧图片 URL
toolsarray最多 32 个工具值
generate_audioboolean是否生成音频
watermarkboolean是否添加水印

first_imagelast_image 不能与参考媒体同时使用。视频解码器目前接受 JSON 请求体。

查询任务状态

请使用以下接口查询任务状态:

http
GET /v1/videos/{task_id}

响应状态值:

  • queued
  • processing
  • completed
  • failed

获取视频

任务完成后,请尽快通过以下接口获取生成的视频:

http
GET /v1/videos/{task_id}/content

返回视频流

错误

常见的校验错误包括:

  • prompt is required
  • duration must be an integer between 4 and 15
  • invalid resolution
  • invalid aspect_ratio
  • reference_audios requires a reference image or video
  • first/last image cannot be combined with reference media