> ## 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 训练工件的临时 URL。

`GET /v1/training-jobs/{job_id}/download`

返回训练工件的预签名 URL。请另行请求返回的 URL 以下载文件。

## 请求

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

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

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.fastino.ai/v1/training-jobs/YOUR_TRAINING_JOB_ID/download \
    -H "X-API-Key: $FASTINO_API_KEY"
  ```
</RequestExample>

## 响应

<ResponseField name="success" type="boolean">
  URL 是否已生成。
</ResponseField>

<ResponseField name="job_id" type="string">
  训练任务 UUID。
</ResponseField>

<ResponseField name="download_url" type="string">
  临时的预签名工件 URL。
</ResponseField>

<ResponseField name="expires_in_seconds" type="integer">
  URL 有效期。默认为 3600 秒。
</ResponseField>

<ResponseField name="file_name" type="string">
  建议的下载文件名。
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "job_id": "YOUR_TRAINING_JOB_ID",
    "download_url": "https://...",
    "expires_in_seconds": 3600,
    "file_name": "my-model-name-weights.zip",
    "message": "Download URL generated successfully"
  }
  ```
</ResponseExample>

<Warning>
  预签名 URL 是一种临时的 bearer 凭证。请勿记录、提交、持久化或分享它。请及时下载工件，并按照您的数据处理策略进行存储。
</Warning>

如需在一个流程中请求 URL 并下载工件：

```bash theme={null}
response=$(curl -fsS \
  https://api.fastino.ai/v1/training-jobs/YOUR_TRAINING_JOB_ID/download \
  -H "X-API-Key: $FASTINO_API_KEY")

curl -fL \
  -o "$(jq -r '.file_name' <<<"$response")" \
  "$(jq -r '.download_url' <<<"$response")"
```

此示例需要 `jq`。

未知任务或没有可下载工件的任务会返回请求相关的 `4xx` 错误。
