跳转到主要内容
使用 /v1/tasks/{task_id} 查询异步任务状态。
curl https://api.apiany.ai/v1/tasks/task_123 \
  -H "Authorization: Bearer $APIANY_API_KEY"

状态值

  • pending
  • processing
  • completed
  • failed
  • expired

成功任务

{
  "task_id": "task_123",
  "status": "completed",
  "model": "nano-banana",
  "result": {
    "type": "image",
    "urls": ["https://.../result.png"]
  }
}

失败任务

{
  "task_id": "task_123",
  "status": "failed",
  "error": {
    "type": "service_error",
    "message": "任务未能完成。"
  }
}