Appearance
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
}请求参数
以下参数由插件的视频解码器支持:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
model | string | 是 | 此渠道必须使用 doubao-seedance-2.0-discount |
prompt | string | 是 | 文本提示词。使用 Responses 时也可以改用 input |
duration | integer | 否 | 视频时长,单位为秒,范围为 4 到 15;默认为 5 |
resolution | string | 否 | 480p、720p 或 1080p |
aspect_ratio | string | 否 | 16:9、9:16、1:1、4:3、3:4、21:9 或 adaptive |
seed | integer | 否 | 随机种子,必须大于或等于 -1 |
reference_images | string[] | 否 | 最多 9 个参考图片 URL |
reference_videos | string[] | 否 | 最多 3 个参考视频 URL |
reference_audios | string[] | 否 | 最多 3 个参考音频 URL;需要同时提供参考图片或视频 |
first_image | string[] | 否 | 最多 1 个首帧图片 URL |
last_image | string[] | 否 | 最多 1 个末帧图片 URL |
tools | array | 否 | 最多 32 个工具值 |
generate_audio | boolean | 否 | 是否生成音频 |
watermark | boolean | 否 | 是否添加水印 |
first_image 和 last_image 不能与参考媒体同时使用。视频解码器目前接受 JSON 请求体。
查询任务状态
请使用以下接口查询任务状态:
http
GET /v1/videos/{task_id}响应状态值:
queuedprocessingcompletedfailed
获取视频
任务完成后,请尽快通过以下接口获取生成的视频:
http
GET /v1/videos/{task_id}/content返回视频流
错误
常见的校验错误包括:
prompt is requiredduration must be an integer between 4 and 15invalid resolutioninvalid aspect_ratioreference_audios requires a reference image or videofirst/last image cannot be combined with reference media