Wan 2.7
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-2.7",
"input": {
"mode": "text_to_video",
"prompt": "A paper boat drifting on a calm pond at sunrise, gentle ripples",
"resolution": "720p",
"duration": 2,
"aspect_ratio": "16:9"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'wan-2.7',
input: {
mode: 'text_to_video',
prompt: 'A paper boat drifting on a calm pond at sunrise, gentle ripples',
resolution: '720p',
duration: 2,
aspect_ratio: '16:9'
}
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"model": "wan-2.7",
"input": {
"mode": "text_to_video",
"prompt": "A paper boat drifting on a calm pond at sunrise, gentle ripples",
"resolution": "720p",
"duration": 2,
"aspect_ratio": "16:9"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}Alibaba
Wan 2.7
统一 720p/1080p 视频接口,支持文生、首尾帧、多参考(含音色绑定)与视频编辑。
POST
/
api
/
v1
/
tasks
/
create_task
Wan 2.7
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-2.7",
"input": {
"mode": "text_to_video",
"prompt": "A paper boat drifting on a calm pond at sunrise, gentle ripples",
"resolution": "720p",
"duration": 2,
"aspect_ratio": "16:9"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'wan-2.7',
input: {
mode: 'text_to_video',
prompt: 'A paper boat drifting on a calm pond at sunrise, gentle ripples',
resolution: '720p',
duration: 2,
aspect_ratio: '16:9'
}
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"model": "wan-2.7",
"input": {
"mode": "text_to_video",
"prompt": "A paper boat drifting on a calm pond at sunrise, gentle ripples",
"resolution": "720p",
"duration": 2,
"aspect_ratio": "16:9"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}参数与输入模式
请求须传入model 与 input。省略 input.mode 时默认按 text_to_video 处理;其余三种工作流须显式指定 mode(不会自动推断),且所有字段按所选模式校验。默认值与限制见下方 Body 参数列表。
nsfw_check=true 启用本站筛查,否则跳过。
| 请求场景 | input 必填字段 |
|---|---|
| 文生视频 | prompt(mode 可省略,默认 "text_to_video") |
| 首尾帧图生视频 | mode: "image_to_video"、first_frame_url(可选 last_frame_url、reference_audio_urls) |
| 多参考生视频 | mode: "reference_to_video"、prompt、≥1 项图/视频(扁平图片字段或 image_with_roles,及/或 reference_video_urls) |
| 视频编辑 | mode: "video_edit"、source_video_url(可选 prompt、reference_image_urls) |
特殊模式说明
以下说明各模式的字段隔离与组合规则;具体默认值、时长范围与素材上限见下方 Body 参数列表。- 模式隔离:混传其他模式的字段会返回 HTTP 400;省略
resolution前请核对 Body 默认值。 - 参考模式(
reference_to_video):image_with_roles与扁平图片互斥;有首帧须省略aspect_ratio;含参考视频时收紧 Body 时长上限。 - 编辑模式(
video_edit):默认duration跟随源片;显式时长从片头截取且不超源片。不支持续写与特效模板。
使用场景
提交到POST /api/v1/tasks/create_task。files.apistable.ai 为托管样本;请将 cdn.example.com 替换为符合 Body 限制的公网 HTTPS 直链。
{
"model": "wan-2.7",
"input": {
"mode": "text_to_video",
"prompt": "A paper boat drifting on a calm pond at sunrise, gentle ripples",
"resolution": "720p",
"duration": 2,
"aspect_ratio": "16:9"
}
}
{
"model": "wan-2.7",
"input": {
"mode": "image_to_video",
"first_frame_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-keyframes-input-0.jpg",
"last_frame_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-keyframes-input-1.jpg",
"prompt": "Smooth transition as morning mist lifts and warm sunlight brightens the pond.",
"resolution": "1080p",
"duration": 5
}
}
{
"model": "wan-2.7",
"input": {
"mode": "reference_to_video",
"prompt": "Keep the folded paper boat appearance from the reference image and the calm golden-hour pond setting and visual style from the reference video as gentle ripples spread.",
"reference_image_urls": [
"https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-reference-input-0.jpg"
],
"reference_video_urls": [
"https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-snow-edit-input-0.mp4"
],
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9"
}
}
{
"model": "wan-2.7",
"input": {
"mode": "reference_to_video",
"prompt": "Medium close-up of the studio host from the character reference image speaking calmly into the camera in the bound reference voice, warm studio key light, soft background.",
"image_with_roles": [
{
"url": "https://cdn.example.com/character-host.jpg",
"role": "reference_image",
"reference_voice": "https://cdn.example.com/host-voice.mp3"
}
],
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": 5
}
}
{
"model": "wan-2.7",
"input": {
"mode": "video_edit",
"source_video_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-snow-edit-input-0.mp4",
"reference_image_urls": [
"https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-reference-input-0.jpg"
],
"prompt": "Replace the distant background with a softly blurred snowy shoreline while keeping the white paper boat, water ripples, and camera motion unchanged.",
"resolution": "720p",
"duration": 0,
"metadata": {
"audio_setting": "origin"
}
}
}
凭响应中的data.task_id通过 查询任务 或callback_url(Webhook 安全与验签)获取结果;鉴权见 快速开始,提交错误见 创建任务。视频链接保留 14 天;超 24 小时未完成将进入超时清理且不扣费。
试用与价格
单次生成 1 条视频,各模式共用秒价。文生/图生按请求输出秒计费;参考/编辑按所有输入视频秒数之和(含重复 URL)加实测输出秒计费(图/音频不计秒)。失败扣费 0。余额见 查询积分余额。| 分辨率 | 积分 / 计费秒 | 美元 / 计费秒 |
|---|---|---|
720p | 17.0 | $0.085 |
1080p(默认) | 28.0 | $0.140 |
在线试用
在工作台测试 Wan 2.7 四种模式。
查看价格
按模式查看 720p/1080p 价格与对比。
授权
登录 APIstable 后,在 API Key 管理 创建并复制密钥。
每次调用都要在 HTTP 请求头传入:
Authorization: Bearer YOUR_API_KEY
将 YOUR_API_KEY 替换为你创建的 API Key。
请求体
application/json
回调
POST{$request.body#/callback_url}Webhook
请求体
application/json
任务成功或失败后,APIstable 向创建任务时传入的 callback_url 发送 JSON POST。验签后返回 HTTP 2xx 确认接收。
用 data.status 判断生成结果。成功时为 succeeded,生成视频链接位于 data.result.urls。全部失败时为 failed,data.result 为 null,data.message 提供失败原因。
签名和去重使用 X-APIstable-Signature、X-APIstable-Timestamp 和 X-APIstable-Event-Id。详见 Webhook 安全与验签。
Webhook 请求体示例
{
"code": 200,
"msg": "success",
"data": {
"task_id": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb",
"model": "wan-2.7",
"status": "succeeded",
"created_at": "2026-11-24T08:30:00.000Z",
"completed_at": "2026-11-24T08:31:45.000Z",
"duration": 105000,
"charged_credits": 85,
"message": "",
"input": "{\"mode\":\"text_to_video\",\"prompt\":\"A paper boat drifting on a calm pond at sunrise, gentle ripples\",\"resolution\":\"720p\",\"aspect_ratio\":\"16:9\",\"duration\":5}",
"result": {
"urls": [
"https://cdn.example.com/generated/wan-video.mp4"
],
"items": [
{
"id": "e7aacd19-819a-4747-bbbf-46fb6f2995a5",
"urls": [
"https://cdn.example.com/generated/wan-video.mp4"
],
"last_frame_url": null,
"draft": false,
"draft_expires_at": null
}
]
}
}
}
响应
2XX
已接收 Webhook。
响应
已受理。使用 task_id 查询任务,或通过 callback_url 接收结果。