API手册
创建视频生成请求
通过输入提示词生成视频。该接口返回用户当前请求的 requestId,用户需要通过轮询状态接口获取具体的视频链接。生成结果有效期为 10 分钟,请及时获取视频链接。
AuthorizationBearer <token>required
添加 Header 'Authorization: Bearer {账户 API Key}' 进行鉴权
In: header
modelstringrequired
对应的模型名称。为更好地提升服务质量,我们会对本服务提供的模型进行定期变更,包括但不限于模型上下线和模型服务能力的调整。在可行的情况下,我们会通过公告或消息推送等适当方式通知您此类变更。完整可用模型列表请查看 Models。
Value in
"Wan-AI/Wan2.2-I2V-A14B" | "Wan-AI/Wan2.2-T2V-A14B"Example
"Wan-AI/Wan2.2-I2V-A14B"promptstringrequired
用于生成视频描述的文本提示词。
negative_promptstring
负面提示词
image_sizestringrequired
生成视频的分辨率。
Value in
"1280x720" | "720x1280" | "960x960"imageUpload Image
当使用模型 Wan-AI/Wan2.2-I2V-14B-720P 时,image 参数为必填项。
Value in
"data:image/png;base64, XXX" | "img_url"Example
"https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641"seedinteger
随机数生成器的种子值。
Response Body
模型响应。响应头中包含 x-siliconcloud-trace-id 字段,作为请求的唯一追踪标识,便于日志查询和问题排查。
TypeScript Definitions
Use the response body type in TypeScript.
requestIdstring
调用状态接口时需要使用本次请求生成的 requestId。
curl --request POST \
--url https://api.siliconflow.cn/v1/video/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Wan-AI/Wan2.2-I2V-A14B",
"prompt": "<string>",
"negative_prompt": "<string>",
"image_size": "1280x720",
"image": "https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641",
"seed": 123
}'
import requests
url = "https://api.siliconflow.cn/v1/video/submit"
payload = {
"model": "Wan-AI/Wan2.2-I2V-A14B",
"prompt": "<string>",
"negative_prompt": "<string>",
"image_size": "1280x720",
"image": "https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641",
"seed": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: '{"model":"Wan-AI/Wan2.2-I2V-A14B","prompt":"<string>","negative_prompt":"<string>","image_size":"1280x720","image":"https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641","seed":123}'
};
fetch('https://api.siliconflow.cn/v1/video/submit', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"requestId": "string"
}{
"code": 20012,
"message": "string",
"data": "string"
}"Invalid token""Forbidden""404 page not found"{
"message": "Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.cn. Details:TPM limit reached.",
"data": "string"
}{
"code": 50505,
"message": "Model service overloaded. Please try again later.",
"data": "string"
}"string"