概览
完整调用流程:
https://files.sudashuiapi.com返回素材 URL。
/v1/video/generations提交文生视频或参考素材生视频任务。
/v1/video/generations/{task_id}轮询任务状态和结果。
data.result_url 或 creations[0].url成功后拿到视频地址。
上传素材文件
上传图片、音频或视频,返回的 url 可用于 imageUrls、audioUrls、videoUrls、firstFrameUrl 或 lastFrameUrl。
curl --location 'https://files.sudashuiapi.com' \
-H 'Authorization: Bearer 你的_API_Key' \
--form 'file=@"/D:/Users/24553/Pictures/004.jpg"'
const form = new FormData();
form.append("file", fileInput.files[0]);
const response = await fetch("https://files.sudashuiapi.com", {
method: "POST",
headers: {
"Authorization": "Bearer 你的_API_Key"
},
body: form
});
const data = await response.json();
import requests
with open(r"D:/Users/24553/Pictures/004.jpg", "rb") as f:
response = requests.post(
"https://files.sudashuiapi.com",
headers={"Authorization": "Bearer 你的_API_Key"},
files={"file": f},
)
print(response.json())
<?php
$ch = curl_init("https://files.sudashuiapi.com");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer 你的_API_Key"],
CURLOPT_POSTFIELDS => [
"file" => new CURLFile("D:/Users/24553/Pictures/004.jpg")
]
]);
echo curl_exec($ch);
{
"url": "https://files.sudashuiapi.com/proxy/1781054530419/1781054530419-004.jpg?..."
}
文件类型与限制
| 类型 | MIME Type | 扩展名 | 上传大小 |
|---|---|---|---|
| 图片 | image/jpeg | .jpeg, .jpg | 单张小于 30 MB |
| 图片 | image/png | .png | 单张小于 30 MB |
| 图片 | image/webp | .webp | 单张小于 30 MB |
| 视频 | video/mp4 | .mp4 | 单个小于 50 MB |
| 视频 | video/quicktime | .mov | 单个小于 50 MB |
| 音频 | audio/mpeg | .mp3 | 单个小于 15 MB |
| 音频 | audio/wav | .wav | 单个小于 15 MB |
创建视频生成任务
获取可用模型
curl https://api.sudashuiapi.com/v1/models \
-H "Authorization: Bearer 你的_API_Key"
官方模型:模型名以 sdas-gf- 开头时属于官方模型,支持真人素材库。使用真人或虚拟人像图片时,需要通过 officialAssetIndexes 标记对应图片。
不要额外传 resolution,分辨率由模型名决定。
基础参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 必须是 /v1/models 或模型广场中当前可用的模型名,分辨率由模型名决定。 |
prompt | string | 建议填写 | 提示词,支持 @image1、@audio1、@video1 等引用。 |
duration | number | 是 | 通用文档范围为 4 到 15 秒;具体可用时长以模型广场中的单模型说明为准。 |
metadata.payload | string | 是 | JSON 字符串,不能直接传 JSON 对象。 |
images、imageUrls、videoUrls、audioUrls、firstFrameUrl、lastFrameUrl、aspectRatio、mode、resolution。metadata.payload 参数
metadata.payload 是一个 JSON 字符串。它内部的 JSON 对象支持以下字段:
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
aspectRatio | string | 是 | 画面比例 |
mode | string | 是 | 生成模式:references 或 frames |
imageUrls | string[] | 否 | 图片 URL 数组,references 模式使用,最多 9 张 |
videoUrls | string[] | 否 | 视频 URL 数组,references 模式使用,最多 3 个 |
audioUrls | string[] | 否 | 音频 URL 数组,references 模式使用,最多 3 个 |
firstFrameUrl | string | 条件必填 | 首帧图片 URL,frames 模式必填 |
lastFrameUrl | string | 条件必填 | 尾帧图片 URL,frames 模式必填 |
officialAssetIndexes | integer[] | 官方模型使用真人图时必填 | 标记需要进行官方素材登记的图片下标;仅适用于 sdas-gf- 模型,从 0 开始 |
1:1 3:4 4:3 9:16 16:9 21:9 adaptivereferences frames参数规则
mode=references:用于文生视频、图片参考、视频参考、音频参考,以及多素材组合参考。mode=frames:用于首尾帧视频。mode=frames时必须传firstFrameUrl和lastFrameUrl。mode=frames时不能传imageUrls、videoUrls、audioUrls。mode=references时不能传firstFrameUrl、lastFrameUrl。metadata.payload内不能传model、resolution、duration、prompt。
官方模型真人素材
sdas-gf- 开头时属于官方模型。使用真人或虚拟人像图片时,必须在 metadata.payload 中通过 officialAssetIndexes 指定对应图片。图片仍然先通过文件上传接口上传到 R2,然后把返回的 URL 放入 imageUrls、firstFrameUrl 或 lastFrameUrl。系统只会登记 officialAssetIndexes 标记的图片;动漫、插画、背景图等不需要登记的图片不要标记。
officialAssetIndexes 从 0 开始;prompt 中的 @image1 从 1 开始。references模式:下标直接对应imageUrls。例如imageUrls[1]对应officialAssetIndexes: [1],在 prompt 中是@image2。frames模式:firstFrameUrl的下标是0,lastFrameUrl的下标是1。- 多个真人图可以同时标记,例如
officialAssetIndexes: [0, 2]。 - 下标不能重复、不能超出图片范围。素材登记失败时,任务不会降级为普通 URL 提交。
sdas-gf-官方模型当前不支持videoUrls,传入视频参考会返回参数错误。
示例:第一张是普通动漫背景,第二张是真人图,因此只标记下标 1:
{
"model": "sdas-gf-seedance-2.0-fast-720p",
"prompt": "让 @image2 中的人物出现在 @image1 的动漫场景中,自然看向镜头",
"duration": 5,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"imageUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/anime-background.jpg\",\"https://files.sudashuiapi.com/proxy/xxx/person.jpg\"],\"officialAssetIndexes\":[1]}"
}
}
素材顺序对应
| 数组字段 | 数组位置 | prompt 引用 |
|---|---|---|
imageUrls | imageUrls[0] / imageUrls[1] | @image1 / @image2 |
audioUrls | audioUrls[0] / audioUrls[1] | @audio1 / @audio2 |
videoUrls | videoUrls[0] / videoUrls[1] | @video1 / @video2 |
@image1 对应第一张图片,不是文件名中的数字。图片、音频、视频的编号互不影响。
生成任务素材限制
| 素材类型 | 数量限制 | 大小限制 | 时长限制 | 其他限制 |
|---|---|---|---|---|
| 图片 | 最多 9 张 | 单张小于 30 MB | - | 支持 jpg / jpeg / png / webp |
| 音频 | 最多 3 个 | 单个小于 15 MB | 总时长不超过 15 秒 | 支持 mp3 / wav |
| 视频 | 最多 3 个 | 单个小于 50 MB | 总时长 ≥ 2 秒且 ≤ 15 秒 | 像素总数范围:409600 到 927408,例如 640x640 到 834x1112 |
imageUrls、audioUrls、videoUrls 三个数组中的 URL 总数量必须小于等于 12。创建任务响应
创建成功响应
创建成功后会返回任务对象。请保存 task_id,用于后续查询。
{
"id": "task_DrwbCgmERlqqvftqyf2o59FaWynwJPDN",
"task_id": "task_DrwbCgmERlqqvftqyf2o59FaWynwJPDN",
"object": "video",
"model": "sd-api-2-fast-720p",
"status": "queued",
"progress": 0,
"created_at": 1780990464
}
创建失败响应
参数不合法、鉴权失败或其他请求错误时,会返回失败响应。常见参数错误示例:
{
"code": "fail_to_fetch_task",
"message": "{\"state\":\"failed\",\"err_code\":\"invalid_request\",\"message\":\"duration must be from 4 to 15 seconds.\",\"creations\":[]}",
"data": null
}
创建任务场景示例
文生视频
无素材curl https://api.sudashuiapi.com/v1/video/generations \
-H "Authorization: Bearer 你的_API_Key" \
-H "Content-Type: application/json" \
-d '{
"model": "sd-api-2-fast-720p",
"prompt": "一只可爱的小猫,电影感镜头",
"duration": 4,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\"}"
}
}'
const response = await fetch("https://api.sudashuiapi.com/v1/video/generations", {
method: "POST",
headers: {
"Authorization": "Bearer 你的_API_Key",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "sd-api-2-fast-720p",
prompt: "一只可爱的小猫,电影感镜头",
duration: 4,
metadata: {
payload: JSON.stringify({ aspectRatio: "16:9", mode: "references" })
}
})
});
const data = await response.json();
import json
import requests
response = requests.post(
"https://api.sudashuiapi.com/v1/video/generations",
headers={
"Authorization": "Bearer 你的_API_Key",
"Content-Type": "application/json",
},
json={
"model": "sd-api-2-fast-720p",
"prompt": "一只可爱的小猫,电影感镜头",
"duration": 4,
"metadata": {
"payload": json.dumps({"aspectRatio": "16:9", "mode": "references"})
},
},
)
print(response.json())
<?php
$payload = [
"model" => "sd-api-2-fast-720p",
"prompt" => "一只可爱的小猫,电影感镜头",
"duration" => 4,
"metadata" => [
"payload" => json_encode(["aspectRatio" => "16:9", "mode" => "references"])
]
];
$ch = curl_init("https://api.sudashuiapi.com/v1/video/generations");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer 你的_API_Key",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE)
]);
echo curl_exec($ch);
单图参考生视频
@image1{
"model": "sd-api-2-fast-720p",
"prompt": "让 @image1 里的小猫动起来,电影感镜头",
"duration": 4,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"imageUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/cat.jpg\"]}"
}
}
多图参考生视频
@image1 + @image2{
"model": "sd-api-2-fast-720p",
"prompt": "让 @image1 里的角色进入 @image2 的场景中,自然运镜,电影感镜头",
"duration": 4,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"imageUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/character.jpg\",\"https://files.sudashuiapi.com/proxy/xxx/scene.jpg\"]}"
}
}
图片 + 音频参考
@image1 + @audio1{
"model": "sd-api-2-fast-720p",
"prompt": "让 @image1 里的角色跟着 @audio1 的节奏做动作",
"duration": 4,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"imageUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/character.jpg\"],\"audioUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/music.mp3\"]}"
}
}
视频参考
@video1{
"model": "sd-api-2-fast-720p",
"prompt": "参考 @video1 的动作,把主体变成可爱小猫,动画风格",
"duration": 4,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"videoUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/reference.mp4\"]}"
}
}
图片 + 视频 + 音频参考
@image1 + @video1 + @audio1{
"model": "sd-api-2-fast-720p",
"prompt": "让 @image1 里的角色参考 @video1 的动作,并跟随 @audio1 的节奏,生成电影感视频",
"duration": 4,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"imageUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/character.jpg\"],\"videoUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/action.mp4\"],\"audioUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/music.mp3\"]}"
}
}
多图 + 多音频 + 多视频参考
多素材组合{
"model": "sd-api-2-fast-720p",
"prompt": "让 @image1 的角色在 @image2 的场景中,参考 @video1 的动作,配合 @audio1 的节奏,结尾参考 @video2 的镜头运动",
"duration": 6,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"references\",\"imageUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/character.jpg\",\"https://files.sudashuiapi.com/proxy/xxx/scene.jpg\"],\"videoUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/action.mp4\",\"https://files.sudashuiapi.com/proxy/xxx/camera.mp4\"],\"audioUrls\":[\"https://files.sudashuiapi.com/proxy/xxx/music.mp3\",\"https://files.sudashuiapi.com/proxy/xxx/effect.wav\"]}"
}
}
首尾帧生成视频
frames首尾帧模式使用 firstFrameUrl 和 lastFrameUrl,不要再传 imageUrls。
{
"model": "sd-2-1080p",
"prompt": "从第一张图自然过渡到第二张图,电影感镜头",
"duration": 6,
"metadata": {
"payload": "{\"aspectRatio\":\"16:9\",\"mode\":\"frames\",\"firstFrameUrl\":\"https://files.sudashuiapi.com/proxy/xxx/first.jpg\",\"lastFrameUrl\":\"https://files.sudashuiapi.com/proxy/xxx/last.jpg\"}"
}
}
官方2请求文档
sdas-gf2- 开头时,请使用字符串字段 seconds 和 metadata.content[]。不要使用上方“创建视频生成任务”大类中的 duration + metadata.payload 格式,也不要混用两套字段。请求规则
seconds,可选值为 "4" 到 "15"。metadata.content[],不要传顶层 images。metadata.ratio,支持 16:9、9:16、1:1、4:3、3:4、21:9、adaptive。resolution;如果传入,必须与模型名后缀一致。- 所有请求都需要携带
Authorization: Bearer 你的_API_Key和Content-Type: application/json。 metadata.payload不适用于官方2原生请求;不要依赖其中的officialAssetIndexes。- 不要同时使用顶层
images和metadata.content[],否则素材内容可能被替换。 - 官方2当前支持图片和音频素材,不支持任何视频参考,请勿传
video_url或@videoN。
模型与请求参数
| 模型 | 固定分辨率 |
|---|---|
sdas-gf2-seedance-2.0-480p | 480p |
sdas-gf2-seedance-2.0-720p | 720p |
sdas-gf2-seedance-2.0-1080p | 1080p |
sdas-gf2-seedance-2.0-fast-480p | 480p |
sdas-gf2-seedance-2.0-fast-720p | 720p |
sdas-gf2-seedance-2.0-mini-480p | 480p |
sdas-gf2-seedance-2.0-mini-720p | 720p |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 官方2模型名,分辨率由模型名决定。 |
prompt | string | 建议填写 | 视频提示词;素材可通过 @imageN、@audioN 引用。 |
seconds | string | 是 | 整数秒数字符串,范围为 "4" 到 "15"。 |
metadata.ratio | string | 建议填写 | 视频画面比例。 |
metadata.content | object[] | 使用素材时必填 | 图片和音频素材列表;文生视频可省略。 |
metadata.watermark | boolean | 否 | 是否添加水印。 |
metadata.generate_audio | boolean | 否 | 是否要求模型生成音频,不表示输入参考音频。 |
素材上传与引用规则
先通过文件上传接口上传本地图片或音频,然后将返回的 HTTPS URL 原样放入 image_url.url 或 audio_url.url。
curl --location "https://files.sudashuiapi.com" \
-H "Authorization: Bearer 你的_API_Key" \
--form "file=@/path/to/person.jpg"
{
"url": "https://files.sudashuiapi.com/proxy/uploads/20260720/example-person.jpg"
}
素材 URL 必须以 https://files.sudashuiapi.com 开头。不要传本地路径、Base64、file://、HTTP URL 或其他域名。
| 素材类型 | type | role | 用途 |
|---|---|---|---|
| 图片 | image_url | first_frame | 图生视频的起始帧 |
| 图片 | image_url | last_frame | 首尾帧任务的结束帧 |
| 图片 | image_url | reference_image | 人物、场景、服装或风格等参考图 |
| 音频 | audio_url | reference_audio | 声音、音乐或节奏参考 |
- 图片和音频分别独立编号,编号都从 1 开始。
@imageN对应metadata.content[]中第 N 个图片条目;@audioN对应第 N 个音频条目。- 图片和音频可以交叉排列,各自只按同类型条目的出现顺序编号。
first_frame和last_frame也属于图片,会占用图片编号。- 建议固定使用小写
@imageN、@audioN。图生视频的首帧通常不需要在 prompt 中写@image1。
content[0] = 图片 A -> @image1
content[1] = 音频 A -> @audio1
content[2] = 图片 B -> @image2
content[3] = 音频 B -> @audio2
官方2请求示例
以下示例均提交到 POST https://api.sudashuiapi.com/v1/video/generations。
文生视频
无需素材文生视频不传 metadata.content。
{
"model": "sdas-gf2-seedance-2.0-fast-720p",
"prompt": "傍晚的海边城市,云层缓慢移动,镜头从街道平稳推进到海面,电影感光影",
"seconds": "5",
"metadata": {
"ratio": "16:9",
"watermark": false,
"generate_audio": true
}
}
图生视频
first_frame将图片设置为 first_frame。如果图片只用于人物或风格参考,请改用 reference_image 并在 prompt 中写 @image1。
{
"model": "sdas-gf2-seedance-2.0-720p",
"prompt": "人物自然抬头看向镜头,头发随风轻微摆动,镜头缓慢向前推进,保持人物身份和画面构图稳定",
"seconds": "6",
"metadata": {
"ratio": "16:9",
"content": [
{
"type": "image_url",
"role": "first_frame",
"image_url": {
"url": "https://files.sudashuiapi.com/proxy/uploads/person-start.jpg"
}
}
]
}
}
多图参考生视频
@image1 + @image2 + @image3{
"model": "sdas-gf2-seedance-2.0-720p",
"prompt": "让 @image1 中的人物穿着 @image2 中的服装,走进 @image3 的学校操场,人物身份和服装细节保持稳定,电影感跟拍镜头",
"seconds": "8",
"metadata": {
"ratio": "16:9",
"content": [
{
"type": "image_url",
"role": "reference_image",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/person.jpg" }
},
{
"type": "image_url",
"role": "reference_image",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/clothes.png" }
},
{
"type": "image_url",
"role": "reference_image",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/playground.jpg" }
}
]
}
}
多图、多音频参考生视频
图片与音频独立编号输入参考音频已经通过 audio_url 提供时,通常不需要再设置 generate_audio。
{
"model": "sdas-gf2-seedance-2.0-480p",
"prompt": "让 @image1 和 @image2 中的人物走在 @image3 的学校操场上。@image2 使用 @audio1 的声音说大家好,背景动作节奏参考 @audio2,人物身份和口型保持自然",
"seconds": "15",
"metadata": {
"ratio": "16:9",
"content": [
{
"type": "image_url",
"role": "reference_image",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/person-1.jpg" }
},
{
"type": "image_url",
"role": "reference_image",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/person-2.png" }
},
{
"type": "image_url",
"role": "reference_image",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/playground.jpg" }
},
{
"type": "audio_url",
"role": "reference_audio",
"audio_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/voice.mp3" }
},
{
"type": "audio_url",
"role": "reference_audio",
"audio_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/rhythm.wav" }
}
]
}
}
首尾帧生视频
first_frame + last_frame{
"model": "sdas-gf2-seedance-2.0-720p",
"prompt": "镜头从第一帧自然过渡到最后一帧,人物动作连贯,场景结构稳定,避免突然切换",
"seconds": "6",
"metadata": {
"ratio": "16:9",
"content": [
{
"type": "image_url",
"role": "first_frame",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/first-frame.jpg" }
},
{
"type": "image_url",
"role": "last_frame",
"image_url": { "url": "https://files.sudashuiapi.com/proxy/uploads/last-frame.jpg" }
}
]
}
}
官方2任务查询
提交成功后记录返回的 id 或 task_id:
{
"id": "task_xxxxxxxxx",
"task_id": "task_xxxxxxxxx",
"status": "queued"
}
curl "https://api.sudashuiapi.com/v1/video/generations/task_xxxxxxxxx" \
-H "Authorization: Bearer 你的_API_Key"
| 状态 | 含义 |
|---|---|
SUBMITTED | 已提交或排队中 |
IN_PROGRESS | 处理中 |
SUCCESS | 已完成 |
FAILURE | 已失败 |
查询响应中的任务状态以 data.status 为准。
官方2查询成功响应
任务成功后,视频地址可从 data.result_url 或 data.data.content.video_url 获取;两个字段通常指向同一个已转存视频。
{
"code": "success",
"message": "",
"data": {
"id": 348856,
"created_at": 1784554446,
"updated_at": 1784554766,
"task_id": "task_EVIaSjG5007TnefMIQhehPDWN0HzkK7T",
"platform": "54",
"user_id": 1,
"group": "ssvip",
"channel_id": 26,
"quota": 6375000,
"action": "generate",
"status": "SUCCESS",
"fail_reason": "",
"result_url": "https://files.sudashuiapi.com/proxy/outputs/gf02/task_obbCpAqW0gl6vszvLxregnBqTTAAhrZu.mp4",
"submit_time": 1784554446,
"start_time": 1784554489,
"finish_time": 1784554766,
"progress": "100%",
"properties": {
"input": "",
"upstream_model_name": "sdas-gf2-seedance-2.0-1080p",
"origin_model_name": "sdas-gf2-seedance-2.0-1080p"
},
"data": {
"id": "gf02:task_obbCpAqW0gl6vszvLxregnBqTTAAhrZu",
"usage": {
"total_tokens": 196425,
"completion_tokens": 196425
},
"status": "succeeded",
"content": {
"video_url": "https://files.sudashuiapi.com/proxy/outputs/gf02/task_obbCpAqW0gl6vszvLxregnBqTTAAhrZu.mp4"
}
}
}
}
官方2常见错误
| 错误或现象 | 检查方式 |
|---|---|
unsupported_duration | 确认使用字符串 seconds,并且值为 "4" 到 "15"。 |
| 图片或音频没有传到 Provider | 确认素材在 metadata.content[] 中;不要使用 metadata.payload,也不要混用顶层 images。 |
invalid_asset | 检查 URL 域名、素材格式及大小;图片不超过 9 张,音频不超过 3 个,总数不超过 12 个,并且没有视频素材。 |
| Prompt 中的素材引用不生效 | 按 metadata.content[] 中同类型素材的出现顺序使用小写 @imageN、@audioN。 |
unsupported_resolution | 删除 resolution,或确保它与模型名的分辨率后缀一致。 |
| 任务已生成但一直处理中 | 服务需要在拿到有效视频 URL、正整数用量信息且视频成功转存后才会返回完成,请稍后继续轮询。 |
查询任务
curl https://api.sudashuiapi.com/v1/video/generations/task_DrwbCgmERlqqvftqyf2o59FaWynwJPDN \
-H "Authorization: Bearer 你的_API_Key"
const response = await fetch(
"https://api.sudashuiapi.com/v1/video/generations/task_DrwbCgmERlqqvftqyf2o59FaWynwJPDN",
{ headers: { "Authorization": "Bearer 你的_API_Key" } }
);
const data = await response.json();
import requests
response = requests.get(
"https://api.sudashuiapi.com/v1/video/generations/task_DrwbCgmERlqqvftqyf2o59FaWynwJPDN",
headers={"Authorization": "Bearer 你的_API_Key"},
)
print(response.json())
<?php
$ch = curl_init("https://api.sudashuiapi.com/v1/video/generations/task_DrwbCgmERlqqvftqyf2o59FaWynwJPDN");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer 你的_API_Key"]
]);
echo curl_exec($ch);
状态说明
| 外层状态 | 内层 state | 含义 |
|---|---|---|
SUBMITTED | queueing | 已提交,排队中 |
IN_PROGRESS | processing | 生成中 |
SUCCESS | success | 生成成功 |
FAILURE | failed | 生成失败 |
成功示例
{
"code": "success",
"message": "",
"data": {
"task_id": "task_DrwbCgmERlqqvftqyf2o59FaWynwJPDN",
"status": "SUCCESS",
"result_url": "https://files.sudashuiapi.com/proxy/generating/output.mp4",
"progress": "100%",
"data": {
"state": "success",
"message": "",
"err_code": "",
"creations": [
{
"id": "6a27c2007f67cc1d1c5bdcc7",
"url": "https://files.sudashuiapi.com/proxy/generating/output.mp4",
"cover_url": "https://files.sudashuiapi.com/proxy/generating/first.jpg"
}
]
}
}
}
失败示例
{
"code": "success",
"message": "",
"data": {
"task_id": "task_mDlJcHGjpem3n6aR4I0DeiYMOqvtWAA6",
"status": "FAILURE",
"fail_reason": "Real human faces are not supported.",
"result_url": "Real human faces are not supported.",
"progress": "100%",
"data": {
"state": "failed",
"message": "Real human faces are not supported.",
"err_code": "Real human faces are not supported.",
"creations": []
}
}
}
错误响应
参数错误
{
"code": "fail_to_fetch_task",
"message": "{\"state\":\"failed\",\"err_code\":\"invalid_request\",\"message\":\"duration must be from 4 to 15 seconds.\",\"creations\":[]}",
"data": null
}
常见错误原因
| 错误原因 | 说明 |
|---|---|
duration must be from 4 to 15 seconds | 时长不在 4-15 秒范围内。 |
metadata.payload.aspectRatio must be one of... | 画面比例不合法。 |
metadata.payload.mode must be one of... | 生成模式不合法。 |
Do not pass top-level images... | 媒体参数不能放外层。 |
officialAssetIndexes 下标 ... 超出图片范围 | 真人素材下标不存在;检查图片数组顺序并使用从 0 开始的下标。 |
当前不支持参考视频,请删除视频素材 | sdas-gf- 官方模型不能使用 videoUrls。 |
unauthorized | 缺少或使用了无效 API Key。 |