> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yir.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 任务生命周期

> 理解异步任务 ID、轮询、终态、进度和未知结果。

Yir 接受请求后会返回稳定任务 ID。任务独立于原始 HTTP 连接继续执行，客户端应保存 ID 并查询到终态。

| 业务含义   | KIE 兼容       | APIMart 兼容   |
| ------ | ------------ | ------------ |
| 已接受或排队 | `waiting`    | `pending`    |
| 正在运行   | `generating` | `processing` |
| 确认成功   | `success`    | `completed`  |
| 确认失败   | `fail`       | `failed`     |

<Warning>
  超时、临时网络错误或 Provider 变慢都不能证明任务失败。继续查询相同任务 ID，不要自动创建替代任务。
</Warning>

成功时，KIE 兼容响应通过 `resultJson` 提供结果 URL；APIMart 兼容响应通过 `result.images` 提供结果。
