Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
通过 AnyFast API 调用阿里巴巴 Wan2.2 T2V A14B 文生视频模型。
GET /v1/video/generations/{task_id}
status
succeeded
width
height
# 第一步 — 创建任务 curl https://www.anyfast.ai/v1/video/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.2-t2v-a14b", "prompt": "一只猫在弹钢琴", "duration": 5 }' # 第二步 — 轮询直到完成 curl https://www.anyfast.ai/v1/video/generations/{TASK_ID} \ -H "Authorization: Bearer YOUR_API_KEY"
import requests, time headers = {"Authorization": "Bearer YOUR_API_KEY"} # 第一步 — 创建任务 resp = requests.post( "https://www.anyfast.ai/v1/video/generations", headers=headers, json={ "model": "wan2.2-t2v-a14b", "prompt": "一只猫在弹钢琴", "duration": 5, } ) task_id = resp.json()["task_id"] # 第二步 — 轮询直到完成 while True: result = requests.get( f"https://www.anyfast.ai/v1/video/generations/{task_id}", headers=headers ).json() status = result["data"]["status"] if status == "succeeded": print(result["data"]["url"]) break elif status == "failed": print("失败:", result["data"]["error"]) break time.sleep(3)
model
wan2.2-t2v-a14b
prompt
duration
5
seed
metadata
queued
processing
data.url
failed
data.error
此页面对您有帮助吗?