sdas-gf-seedance-2.0-fast-720pFENGLIN AI · VIDEO API
视频生成 API 文档
使用统一 API Key 获取模型、上传素材、创建 Seedance 视频任务并轮询结果。平台仅提供 API, 不提供站内生成工具。
https://api.fenglinzhong.top
AUTHENTICATION
鉴权
所有 API 请求都需要在请求头中携带枫林 AI API Key。Key 只应保存在服务端,不能放入浏览器、 移动端安装包或公开仓库。
Authorization: Bearer fl-your-api-key
Content-Type: application/json
示例中的 fl-your-api-key 是占位符。不要把真实 Key 提交到 Git、日志或前端代码。
QUICKSTART
最短调用流程
- 1调用
GET /v1/models确认当前 Key 能使用的模型。
- 2按需调用
POST /v1/files将返回的 URL 写入
metadata.payload。 - 3调用
POST /v1/video/generations保存返回的本地
task_id。 - 4轮询
GET /v1/video/generations/{task_id}任务成功后读取
data.result_url。
/v1/models
返回当前 API Key 所在分组可用的模型。后台下线的模型会立即从列表移除。
curl https://api.fenglinzhong.top/v1/models + -H "Authorization: Bearer fl-your-api-key"
响应示例
{
"object": "list",
"data": [
{
"id": "sdas-gf-seedance-2.0-1080p",
"object": "model",
"owned_by": "custom"
}
]
}
/v1/files
使用 multipart/form-data 上传单个素材,字段名固定为 file。
| 类型 | MIME | 扩展名 | 单文件限制 |
|---|---|---|---|
| 图片 | image/jpeg | .jpg / .jpeg | 30 MB |
| 图片 | image/png | .png | 30 MB |
| 图片 | image/webp | .webp | 30 MB |
| 音频 | audio/mpeg | .mp3 | 15 MB |
| 音频 | audio/wav | .wav | 15 MB |
| 视频 | video/mp4 | .mp4 | 50 MB |
| 视频 | video/quicktime | .mov | 50 MB |
curl https://api.fenglinzhong.top/v1/files + -H "Authorization: Bearer fl-your-api-key" + -F "file=@./reference.jpg"
{ "url": "https://.../reference.jpg" }/v1/video/generations
创建异步视频任务。metadata.payload 必须是 JSON 字符串;不要把
imageUrls、aspectRatio 或 mode 放到请求外层。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 使用 /v1/models 返回的模型 ID |
prompt | string | 建议 | 支持 @image1、@audio1 引用 |
duration | integer | 是 | 4-15 秒,按实际秒数计费 |
metadata.payload | string | 是 | 内部 JSON 见下方示例 |
curl https://api.fenglinzhong.top/v1/video/generations + -H "Authorization: Bearer fl-your-api-key" + -H "Content-Type: application/json" + -d '{
"model": "sdas-gf-seedance-2.0-1080p",
"prompt": "让 @image1 中的角色自然转身,电影感运镜",
"duration": 5,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"imageUrls\":[\"https://files.example/reference.jpg\"]}"
}
}'
const payload = {
aspectRatio: '16:9',
mode: 'references',
imageUrls: ['https://files.example/reference.jpg'],
};
const response = await fetch(
'https://api.fenglinzhong.top/v1/video/generations',
{
method: 'POST',
headers: {
Authorization: 'Bearer fl-your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'sdas-gf-seedance-2.0-1080p',
prompt: '让 @image1 中的角色自然转身,电影感运镜',
duration: 5,
metadata: { payload: JSON.stringify(payload) },
}),
},
);
const task = await response.json();
import json
import requests
payload = {
"aspectRatio": "16:9",
"mode": "references",
"imageUrls": ["https://files.example/reference.jpg"],
}
response = requests.post(
"https://api.fenglinzhong.top/v1/video/generations",
headers={"Authorization": "Bearer fl-your-api-key"},
json={
"model": "sdas-gf-seedance-2.0-1080p",
"prompt": "让 @image1 中的角色自然转身,电影感运镜",
"duration": 5,
"metadata": {"payload": json.dumps(payload)},
},
timeout=30,
)
response.raise_for_status()
task = response.json()
<?php
$payload = json_encode([
'aspectRatio' => '16:9',
'mode' => 'references',
'imageUrls' => ['https://files.example/reference.jpg'],
]);
$ch = curl_init('https://api.fenglinzhong.top/v1/video/generations');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer fl-your-api-key',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'sdas-gf-seedance-2.0-1080p',
'prompt' => '让 @image1 中的角色自然转身,电影感运镜',
'duration' => 5,
'metadata' => ['payload' => $payload],
]),
]);
$task = json_decode(curl_exec($ch), true);
创建成功响应
{
"id": "task_local_xxxxxxxxxxxx",
"task_id": "task_local_xxxxxxxxxxxx",
"object": "video",
"model": "sdas-gf-seedance-2.0-1080p",
"status": "queued",
"progress": 0,
"created_at": 1784200000
}/v1/video/generations/{task_id}
使用创建任务时返回的枫林 AI 本地 task_id 查询,不能使用任何上游任务 ID。
curl https://api.fenglinzhong.top/v1/video/generations/task_local_xxxxxxxxxxxx + -H "Authorization: Bearer fl-your-api-key"
| 查询状态 | 兼容语义 | 处理方式 |
|---|---|---|
QUEUED | queued | 已排队,继续轮询 |
IN_PROGRESS | in_progress | 生成中,继续轮询 |
SUCCESS | completed | 读取 data.result_url |
FAILURE | failed | 读取 data.fail_reason |
成功响应示例
{
"code": "success",
"message": "",
"data": {
"task_id": "task_local_xxxxxxxxxxxx",
"status": "SUCCESS",
"progress": "100%",
"result_url": "https://files.example/output.mp4",
"fail_reason": ""
}
}PRICING
模型与价格
视频按时长计费,1M 计费单位 = 1 秒。页面中的输入价和补全价只是兼容展示,不会相加扣费。
sdas-gf-seedance-2.0-720psdas-gf-seedance-2.0-1080psdas-gf-seedance-2.0-2ksdas-gf-seedance-2.0-4k任务费用 = duration × 模型每秒价格例:1080p 生成 5 秒,费用为 5 × ¥0.85 = ¥4.25ASSETS
素材与真人标记
imageUrls;提示词中从 @image1 开始引用。
audioUrls;总时长不超过 15 秒。
首发的 5 个 sdas-gf- 官方模型不支持参考视频。
真人或虚拟人像
官方模型使用真人或虚拟人像图片时,需要在 officialAssetIndexes 中标记对应图片。
数组下标从 0 开始,而提示词中的 @image1 从 1 开始。
imageUrls[0]普通背景图@image1imageUrls[1]真人图片@image2officialAssetIndexes: [1]
图片、音频各自独立编号。索引不能重复或越界;真人素材登记失败时任务不会自动降级。
ERRORS
错误处理
保存响应头中的请求 ID,并在工单或联系管理员时提供。上传错误使用 OpenAI 风格包装,任务错误使用顶层字段。
上传错误
{
"error": {
"code": "unsupported_file_type",
"message": "unsupported file type",
"request_id": "req_xxxxxxxx"
}
}任务错误
{
"code": "invalid_duration",
"message": "duration must be from 4 to 15 seconds",
"data": null
}| code | 含义 | 处理 |
|---|---|---|
invalid_duration | 时长不在 4-15 秒 | 修改参数,不要重试原请求 |
model_not_found | 模型不存在或已下线 | 重新调用 /v1/models |
insufficient_quota | 余额不足 | 联系管理员充值 |
unsupported_file_type | 扩展名或 MIME 不支持 | 转换为受支持的格式 |
file_too_large | 素材超过限制 | 压缩素材后重新上传 |
upload_channel_unavailable | 上传通道暂不可用 | 稍后有限次数重试 |
RELIABILITY
轮询与重试
轮询间隔建议 3-5 秒,使用递增退避,最长可逐步增加到 15 秒。
遇到 429 或 5xx 时读取 Retry-After,最多重试 3 次,并加入随机抖动。
不要盲目重试 POST。成功拿到 task_id 后只轮询查询接口。
若网络在创建响应前断开,先用请求 ID 检查控制台日志或联系管理员,确认未创建后再提交。