Full-body portrait-format shot of one adult contemporary dancer in a flowing deep burgundy skirt in a quiet sunlit rehearsal studio with a wooden floor and tall windows, no mirrors. She makes one slow graceful turn on the spot, then settles into a balanced standing pose as the skirt falls naturally around her legs. Her feet remain in contact with the floor and her arms move gently with the turn. Locked camera, entire body and feet always visible, soft daylight, realistic anatomy, one continuous shot, no other people, no text or logos.
Wan 2.2 Fast Text to Video API
alibaba/wan/v2.2-a14b/text-to-video/turboWan 2.2 Fast Text to Video 将自然语言提示词快速转化为支持 480p 与 720p 分辨率的高清流畅视频片段,具备高效的生成速度与灵活的横竖屏画幅适配能力。模型能够精准理解复杂的场景构图与运镜指令,在全片中保持高度的物理连贯性与主体时空一致性。
530/800
示例
REST API 参考
快速上手
提交任务后,使用 task_id 查询结果。
第 1 步:配置认证信息
在控制台创建 API Key,并在发起提交请求时附带 Authorization: Bearer <API_KEY> 请求头。
- 提交接口
- POST
https://api.vidgo.ai/api/generate/submit - 认证请求头
- Authorization: Bearer VIDGO_API_KEY
第 2 步:提交生成任务
POST /api/generate/submit: alibaba/wan/v2.2-a14b/text-to-video/turbo
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/wan/v2.2-a14b/text-to-video/turbo",
"input": {
"prompt": "A cinematic wide shot of one vintage steam train traveling steadily from left to right across a stone viaduct above a lush tropical gorge. The camera tracks sideways smoothly at the train's speed. White steam trails behind the locomotive, drifting over the dense green canopy; a distant waterfall and soft morning mist create layers of depth. The wheels remain on the rails, the carriages stay connected, and the bridge stays rigid. Natural documentary realism, warm early sunlight, one continuous shot, no cuts, no text or logos.",
"resolution": "720p",
"seed": 22400,
"aspect_ratio": "16:9"
}
}
JSON
)
RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"第 3 步:轮询获取生成结果
在状态为 not_started 或 running 时使用 task_id 轮询,到达 finished 或 failed 停止。成功时读取 data.files[].file_url,失败时读取 data.error_message。
状态查询端点
GET https://api.vidgo.ai/api/generate/status/{task_id}使用 task_id 查询进度;not_started 或 running 时继续轮询,finished 或 failed 时停止。成功后读取 data.files[].file_url,失败时读取 data.error_message。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "NSUM0A8GZ7VG20YS",
"status": "running",
"created_time": "2026-09-24T16:47:41"
}
}{
"code": 200,
"data": {
"task_id": "NSUM0A8GZ7VG20YS",
"status": "finished",
"files": [
{
"file_url": "https://cdn.vidgo.ai/apis/models/alibaba/wan/v2.2-a14b/text-to-video/turbo/v1/01/output.mp4",
"file_type": "video"
}
],
"created_time": "2026-09-24T16:47:41",
"error_message": null,
"progress": 100
}
}完整可执行脚本
展开查看包含自动轮询、错误重试与超时保护的端到端调用脚本。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "alibaba/wan/v2.2-a14b/text-to-video/turbo",
"input": {
"prompt": "A cinematic wide shot of one vintage steam train traveling steadily from left to right across a stone viaduct above a lush tropical gorge. The camera tracks sideways smoothly at the train's speed. White steam trails behind the locomotive, drifting over the dense green canopy; a distant waterfall and soft morning mist create layers of depth. The wheels remain on the rails, the carriages stay connected, and the bridge stays rigid. Natural documentary realism, warm early sunlight, one continuous shot, no cuts, no text or logos.",
"resolution": "720p",
"seed": 22400,
"aspect_ratio": "16:9"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数(input 对象)
生成参数置于 input 中,model 和可选的 callback_url 置于请求顶层。使用标准 JSON 类型;传入不支持的 input 字段将被拒绝。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| prompt | string | 是 | - | 必填非空字符串,去除首尾空白后最多 800 个 Unicode 字符。 |
| aspect_ratio | string | 否 | 16:9 | 画面比例:16:9 或 9:16。 |
| resolution | string | 否 | 720p | 输出分辨率:480p 或 720p。 |
| seed | integer | 否 | - | 可选随机种子,用于复现结果。 |
响应字段(查询状态)
GET /api/generate/status/{task_id} 返回的具体内容:
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | HTTP/业务响应状态码(200 表示成功)。 |
| data.task_id | string | 全局唯一的任务标识。 |
| data.status | string | 任务生命周期状态:not_started、running、finished 或 failed。 |
| data.files | array | 生成完成时输出的资产数组,包含 file_url 和 file_type。 |
| data.error_message | string | null | 当任务状态为 failed 时的错误诊断信息。 |
任务生命周期
客户端应持续轮询状态,直到到达 finished 或 failed 终态:
not_started排队中
running生成中
finished已就绪
failed失败
轮询与错误处理
- 轮询间隔建议建议在提交任务 2-3 秒后开始首次状态查询,之后保持 3 秒左右的间隔,直到任务进入 finished 或 failed 终态。
- 网络异常容错查询状态时遭遇瞬时网络超时或 HTTP 5xx 错误并不代表视频生成失败,继续重试状态查询即可。
- 配置 Webhook 回调可在提交请求的顶层传入 callback_url,生成任务在完成或失败时会自动向该地址推送最新状态,减少主动轮询开销。
规格说明
| 规格项 | 取值 | 说明 |
|---|---|---|
| 模型 | alibaba/wan/v2.2-a14b/text-to-video/turbo | |
| 分辨率 | 480p / 720p | 默认 720p |
| 价格 | 480p: $0.030 · 720p: $0.060 | 6 / 12 积分,每次生成 |
相关模型
Wan 2.2 Fast Text to Video API 常见问题
什么是 Wan 2.2 Fast Text to Video API?
Wan 2.2 Fast Text to Video 是阿里巴巴推出的文生视频模型。它能将自然语言提示词快速转化为支持 480p 与 720p 分辨率的高清流畅视频片段,原生支持 16:9 横屏与 9:16 竖屏两种主流画幅。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
Wan 2.2 Fast Text to Video 支持哪些输出分辨率?
Wan 2.2 Fast Text to Video 支持 480p 与 720p 两种清晰度规格。480p 档位响应更快且成本极低,适合大批量创意发散与原型检验;720p 档位画面细腻度与纹理细节更丰富,适合直接用于成品内容交付。
Wan 2.2 Fast Text to Video 支持哪些画面比例?
Wan 2.2 Fast Text to Video 支持两种画面比例:标准 16:9 横屏(适用于电脑桌面、电视及主流宽屏视频)以及 9:16 竖屏(适用于抖音、TikTok、快手、视频号等手机竖屏平台)。可通过 aspect_ratio 参数进行设定。
Wan 2.2 Fast Text to Video 的提示词字符长度上限是多少?
prompt 参数在去除首尾空格后最多允许输入 800 个 Unicode 字符。超过 800 字符的请求将被系统直接以 HTTP 400 校验错误拦截,请在限额内聚焦主体、场景细节及运镜动势的核心描述。
Wan 2.2 Fast Text to Video 的调用费用是多少?
按次计费,费率因分辨率档位而异:480p 单次生成收取 6 积分($0.030),720p 单次生成收取 12 积分($0.060)。提交时扣费,若任务因系统异常最终 failed,积分将自动原路全额退还。
Wan 2.2 Fast Text to Video 的 seed 参数有什么作用?
seed 为可选的整数随机种子。在提示词和画幅比例不变的情况下,传入相同的 seed 可以复现高度一致的画面构图与风格走势,方便针对性地调整局部提示词;留空则每次生成采用随机种子。
Wan 2.2 Fast 与其他 Wan 模型有什么区别?
Wan 2.2 Fast 主打超高生成速度与高性价比,支持 480p 与 720p 视频生成。而标准版 Wan 2.6 或 Wan 2.7 则侧重于更长运镜叙事控制与 1080p 超高画质,算力消耗与生成耗时相应更高。
如何通过 API 获取 Wan 2.2 Fast Text to Video 的生成视频?
向 POST /api/generate/submit 提交请求后,读取返回的 task_id。状态为 not_started 或 running 时,使用 GET /api/generate/status/{task_id} 继续轮询;到达 finished 或 failed 时停止。成功时从 data.files[].file_url 获取视频链接,失败时读取 data.error_message。















