import requests
# generate video task
url = "https://api.gitcode.com/api/v5/video/generate"
headers = {
"Authorization": "Bearer {os.environ['ACCESS_TOKEN']}",
"Content-Type": "application/json"
}
data = {
"model": "Wan2.2-T2V-A14B",
"prompt": "生成动画视频"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
# get task status
url = "https://api.gitcode.com/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())