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

> ## Agent Instructions
> Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing Fastino API routes. Only call operations present in that specification. Do not infer or call undocumented routes. Direct Fastino API integrations use https://api.fastino.ai, /v1 routes, and FASTINO_API_KEY.

# 停止训练任务

> 停止运行中的 Fastino 训练任务,同时保留现有的检查点。

`POST /v1/training-jobs/{job_id}/stop`

停止一个运行中的任务,并保留在停止之前创建的检查点。

## 请求

<ParamField header="X-API-Key" type="string" required>
  您的 Fastino API 密钥。
</ParamField>

<ParamField path="job_id" type="string" required>
  训练任务 UUID。
</ParamField>

JSON 请求体为可选。

<ParamField body="reason" type="string">
  任务被停止的原因。
</ParamField>

<ParamField body="scores" type="object">
  用于做出停止决定的数值指标。
</ParamField>

<ParamField body="checkpoint" type="string">
  与停止相关联的检查点路径或步数。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.fastino.ai/v1/training-jobs/YOUR_TRAINING_JOB_ID/stop \
    -H "X-API-Key: $FASTINO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"reason": "Validation loss stopped improving"}'
  ```
</RequestExample>

## 响应

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Training job stopped",
    "job_id": "YOUR_TRAINING_JOB_ID",
    "status": "stopped"
  }
  ```
</ResponseExample>

未知任务或无法停止的任务返回请求相关的 `4xx` 错误。
