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.
cURL
curl --request GET \ --url https://api.qclawrouter.com/v1/task/{task_id}
查询图像生成异步任务的状态和结果
succeeded
curl https://api.qclawrouter.com/v1/task/task_xxx \ -H "Authorization: Bearer sk-your-api-key"
import requests import time def wait_for_image(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(3) # 每3秒轮询一次
{ "task_id": "task_xxx", "status": "processing", "progress": 50 }
{ "task_id": "task_xxx", "status": "succeeded", "output": { "url": "https://cdn.qclawrouter.com/images/xxx.png" } }
pending
processing
failed