> ## 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/llms.txt to discover and navigate pages. Use https://docs.fastino.ai/llms-full.txt when you need the complete documentation corpus. Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing routes. For GLiDE decision inference, call POST https://api.fastino.ai/v1/systemone with model fastino/GLiDE. Start managed training (config job) with POST /v1/training/jobs using base_model. For interactive training, native JSON clients use the public operations under /v1/training/jobs and /v1/training/usage. Existing Tinker clients use tinker==0.32.0 with TINKER_BASE_URL=https://api.fastino.ai/v1/training/compat/tinker and TINKER_CREDENTIAL_CMD. Compatibility child routes are private and absent from OpenAPI. Auto Train is private access and has no public route; direct interested users to sales@fastino.ai. Do not infer undocumented routes. Read API keys from FASTINO_API_KEY and never embed credentials in code, logs, or reports.

# 使用就绪代理预热微调模型

> 通过 JSON-RPC 调用模型就绪 A2A 代理来预热微调模型，然后轮询任务，或在模型就绪时接收推送通知。

`POST /v1/model-readiness/a2a`

模型就绪代理是一个 [A2A](https://a2a-protocol.org) 0.3 代理，只有一个技能：**Warm a fine-tuned model**（预热微调模型）。向它发送您某个微调模型的 ID，它会创建一个任务来预热该模型；当模型就绪，或无法使其就绪时，任务结束。此过程不运行推理。您可以轮询任务，也可以为代理提供一个 HTTPS 回调，在任务结束时接收该任务。代理卡位于
[`GET /v1/model-readiness/agent-card.json`](https://docs.fastino.ai/cn/api-reference/inference/model-readiness-agent-card)。

每次调用都是一个 JSON-RPC 2.0 请求，并在 `X-API-Key` 中携带您的 API 密钥。所有 JSON-RPC 响应的 HTTP 状态码都是 `200`；请读取响应体中的 `result` 或 `error`。

## 方法

| 方法 | `params` | 结果 |
| - | - | - |
| `message/send` | `message`，以及可选的 `configuration.pushNotificationConfig` | 一个新任务 |
| `tasks/get` | `id`：任务 ID | 该任务 |
| `tasks/cancel` | `id`：任务 ID | 已取消的任务 |
| `tasks/pushNotificationConfig/set` | `taskId` 和 `pushNotificationConfig` | 推送配置，不含其密钥 |
| `tasks/pushNotificationConfig/get` | `id`：任务 ID，以及可选的 `pushNotificationConfigId` | 推送配置，不含其密钥 |
| `tasks/pushNotificationConfig/list` | `id`：任务 ID | 包含零个或一个推送配置的列表 |
| `tasks/pushNotificationConfig/delete` | `id`：任务 ID，以及可选的 `pushNotificationConfigId` | `null` |

不支持流式传输，也不能用另一条消息继续某个任务。

## 创建任务

发送 `message/send`，其中包含一个 `data` 部分，其 `data` 中的 `model_id` 为您团队某个微调模型的 UUID。该模型必须已有发布的工件，并且并非每个微调模型都能以这种方式预热；不受支持的模型会返回错误 `-32602`。

`messageId` 使调用具有幂等性：使用相同 `messageId` 发送相同请求会返回同一个任务；将某个 `messageId` 用于不同请求会返回 `-32602`。

```json message-send.json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "message/send",
  "params": {
    "message": {
      "role": "user",
      "kind": "message",
      "messageId": "warm-support-model-1",
      "parts": [
        {"kind": "data", "data": {"model_id": "YOUR_MODEL_ID"}}
      ]
    },
    "configuration": {
      "pushNotificationConfig": {
        "url": "https://YOUR_AGENT_HOST/fastino/readiness",
        "token": "YOUR_CALLBACK_TOKEN"
      }
    }
  }
}
```

```bash theme={null}
curl https://api.fastino.ai/v1/model-readiness/a2a \
  -H "X-API-Key: $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @message-send.json
```

如需轮询而不是接收推送通知，请省略 `configuration`。

## 任务

`message/send`、`tasks/get` 和 `tasks/cancel` 返回一个 A2A 任务。

| 字段 | 含义 |
| - | - |
| `id` | 任务 ID。`contextId` 的值与之相同。 |
| `kind` | `task`。 |
| `status.state` | 任务运行期间为 `submitted` 或 `working`，之后为 `completed`（模型已就绪）、`failed` 或 `canceled`。 |
| `status.timestamp` | 任务创建的时间，或任务结束的时间。 |
| `metadata.model_id` | 正在预热的模型。 |
| `metadata.error_code` | 任务失败的原因，例如 `warmup_timeout`；或者在您失去对该模型的访问权限而导致任务被取消时为 `access_revoked`。任务运行期间、任务完成时以及您取消任务时为 `null`。 |
| `metadata.readiness_is_observation` | 始终为 `true`：`completed` 表示观察时模型已就绪，而不表示它会一直保持预热。 |
| `metadata.inference_submitted` | 始终为 `false`。 |
| `metadata.push_sent` | 推送通知是否已送达。 |
| `metadata.delivery_attempts` | 推送通知投递失败的次数。 |
| `metadata.delivery_exhausted` | 投递在最后一次尝试后停止时为 `true`。 |

```json Response theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "id": "YOUR_TASK_ID",
    "contextId": "YOUR_TASK_ID",
    "kind": "task",
    "status": {"state": "submitted", "timestamp": "2026-11-19T18:00:00Z"},
    "metadata": {
      "model_id": "YOUR_MODEL_ID",
      "error_code": null,
      "readiness_is_observation": true,
      "inference_submitted": false,
      "push_sent": false,
      "delivery_attempts": 0,
      "delivery_exhausted": false
    }
  }
}
```

未能在 20 分钟内就绪的任务会以 `warmup_timeout` 失败。

## 轮询或取消任务

```json tasks-get.json theme={null}
{"jsonrpc": "2.0", "id": 2, "method": "tasks/get", "params": {"id": "YOUR_TASK_ID"}}
```

使用相同的请求体调用 `tasks/cancel` 可取消尚未结束的任务。取消已结束的任务会返回 `-32002`。

## 推送通知

每个任务最多有一个推送配置；除非您为其指定 `id`，否则为 `default`。请在 `message/send` 中设置：任务结束后，或代理正在处理任务时，`tasks/pushNotificationConfig/set` 和 `delete` 会返回 `-32602`。如果任务没有所请求 ID 的推送配置，`get` 和 `delete` 会返回 `-32001`。

| 字段 | 含义 |
| - | - |
| `url` | 端口 443 上的公共 `https` URL，不含用户信息或片段。 |
| `token` | 16 到 1,024 个可打印 ASCII 字符，会在 `X-A2A-Notification-Token` 请求头中回传。 |
| `authentication` | 可选。`{"schemes": ["Bearer"], "credentials": "..."}` 还会发送 `Authorization: Bearer <credentials>`。 |
| `id` | 可选，最多 100 个字符。默认为 `default`。 |

任务完成或失败时，代理会通过 HTTPS `POST` 将任务对象发送到 `url`。已取消的任务不会发送通知。投递失败时会重试，总共最多尝试 5 次。投递至少一次：请按任务 `id` 和 `status.timestamp` 去重，并在信任通知之前校验 token。

## 限制

每个团队成员最多可以有 3 个尚未结束的任务，每小时最多可以创建 20 个任务。超出任一限制的请求会返回 `-32602`。

已结束的任务会在创建后保留 7 天。此后，针对该任务的调用会返回 `-32001`。

## 错误

| 代码 | 含义 |
| - | - |
| `-32700` | 请求体不是 JSON。 |
| `-32600` | 请求体不是 JSON-RPC 2.0 请求。 |
| `-32601` | 不支持该方法。 |
| `-32602` | 参数、模型或任务状态不允许该请求，或已达到某项限制。 |
| `-32001` | 未找到该任务或模型，或者该任务没有所请求 ID 的推送配置。 |
| `-32002` | 任务已结束，无法取消。 |
| `-32603` | 内部错误。 |

缺少 API 密钥或 API 密钥无效时返回 HTTP `401`。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.