cURL
curl --request GET \ --url https://api.qclawrouter.com/v1/task/{task_id}
查询视频生成异步任务的状态和结果
Documentation IndexFetch the complete documentation index at: https://docs.qclawrouter.com/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: https://docs.qclawrouter.com/llms.txt
Use this file to discover all available pages before exploring further.
curl https://api.qclawrouter.com/v1/task/task_xxx \ -H "Authorization: Bearer sk-your-api-key"
import requests import time def wait_for_video(task_id, api_key): headers = {"Authorization": f"Bearer {api_key}"} while True: resp = requests.get( f"https://api.qclawrouter.com/v1/task/{task_id}", headers=headers ) data = resp.json() if data["status"] == "succeeded": return data["output"]["url"] elif data["status"] == "failed": raise Exception(data["error"]) time.sleep(5) # 每5秒轮询一次
{ "task_id": "task_xxx", "status": "succeeded", "output": { "url": "https://cdn.qclawrouter.com/videos/xxx.mp4", "duration": 5, "resolution": "1080p" } }