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

# 删除或取消训练任务

> 删除训练任务并级联清理其模型、导出、事件与计费。对于运行中的任务，先销毁其容器。

使用此接口永久移除任务及其全部关联资源。对于运行中的任务，系统先通过智能体控制通道销毁训练容器，再级联清理模型、导出、计费记录、事件与干预。

## 方法与路径

```http theme={null}
DELETE /v1/jobs/:id
```

## 认证

在 `Authorization` 头中以 Bearer 令牌的形式携带你的 PIN API 令牌或 JWT。

```http theme={null}
Authorization: Bearer <token>
```

## 路径参数

<ParamField path="id" type="string" required>
  要删除的任务标识符（例如 `jb_abc123def456`）。
</ParamField>

## 请求示例

<CodeGroup>
  ```bash curl theme={null}
  curl -s -X DELETE "https://api.ariacompute.com/v1/jobs/jb_abc123def456" \
    -H "Authorization: Bearer $PIN_API_TOKEN"
  ```
</CodeGroup>

## 响应

返回标准的 PIN 成功信封，确认删除。

<ResponseField name="code" type="integer" required>
  成功为 `0`，出错为非零值。
</ResponseField>

<ResponseField name="data" type="object" required>
  <Expandable title="属性">
    <ResponseField name="job_id" type="string">
      已删除的任务标识符。
    </ResponseField>

    <ResponseField name="deleted" type="boolean">
      成功时恒为 `true`。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="message" type="string">
  可读消息（成功时为空）。
</ResponseField>

### 响应示例

```json theme={null}
{
  "code": 0,
  "data": {
    "job_id": "jb_abc123def456",
    "deleted": true
  },
  "message": ""
}
```

## 错误

| Code | HTTP | 含义                |
| ---- | ---- | ----------------- |
| 401  | 401  | 缺失或无效的 Bearer 令牌。 |
| 404  | 404  | 任务不存在或不属于你。       |
| 500  | 500  | 内部服务器错误。          |

## 说明

* 删除是永久性的，无法撤销。
* 若在停止运行中的任务时智能体控制通道超时，级联清理仍会继续，但错误会记录在任务行上。
* 对于已排队或运行中的任务，若仅需停止训练而不移除产物，建议使用 `POST /v1/jobs/:id/cancel`。
