Skip to Content

任务轮询

提交异步任务后,用任务 ID 轮询结果:

curl http://YOUR_HOST:8000/api/v3/predictions/{id}/result \ -H "Authorization: Bearer wk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

响应:

{ "status": "completed", "data": { "outputs": ["https://upstream.example.com/output.png"] }, "cost": 0.05, "duration_ms": 3200, "error": "" }

status 取值:pending(排队中)、completed(完成)、failed(失败)。轮询建议间隔 2-5 秒。