import requests
# generate video task
url = "/api/v5/video/generate"
headers = {
"Authorization": "Bearer {os.environ['ACCESS_TOKEN']}",
"Content-Type": "application/json"
}
data = {
"model": "Wan2.2-I2V-A14B",
"prompt": "生成动画视频",
"img_url": "https://xxx.xxxxx.com/xxx.png"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
# get task status
url = "/api/v5/video/status"
headers = {
"Authorization": "Bearer {os.environ['ACCESS_TOKEN']}",
"Content-Type": "application/json"
}
data = {
"request_id": "b911321eb7924f34ad51dc45xxxxx"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())