> ## 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.

# 获取智能体

> 按 ID 从咏唱引擎 PIN 获取单个智能体，包括 GPU 详情、状态、版本与部署状态。

检索特定智能体的详细信息。响应包含 GPU 清单、最近心跳、状态、版本、部署状态以及所属节点的绑定关系。

## 接口

**GET** `/v1/agents/:id`

认证：需要 Bearer API 密钥。

## 路径参数

<ParamField path="id" type="string" required>
  智能体标识符，例如 ag\_7f8e9d0c。
</ParamField>

## 响应

<ResponseField name="id" type="string" required>
  智能体标识符。
</ResponseField>

<ResponseField name="name" type="string" required>
  智能体名称。
</ResponseField>

<ResponseField name="gpu_count" type="integer">
  GPU 总数。
</ResponseField>

<ResponseField name="gpu_mem_gb" type="number">
  GPU 总显存，以 GB 为单位。
</ResponseField>

<ResponseField name="labels" type="array of strings">
  调度标签。
</ResponseField>

<ResponseField name="gpus" type="array">
  每块 GPU 的详情：index、model、mem\_total\_gb、mem\_used\_gb、slots、used\_slots。
</ResponseField>

<ResponseField name="last_heartbeat" type="string (ISO 8601)">
  最近一次心跳时间戳。
</ResponseField>

<ResponseField name="status" type="string">
  智能体状态，例如 online。
</ResponseField>

<ResponseField name="node_id" type="string">
  所属 GPU 节点标识符。
</ResponseField>

<ResponseField name="version" type="string">
  智能体二进制版本。
</ResponseField>

<ResponseField name="deploy_state" type="string">
  部署状态，例如 deployed 或 updating。
</ResponseField>

<ResponseField name="last_error" type="string">
  最近一次部署或操作错误（若有）。
</ResponseField>

<ResponseField name="agent_uid" type="string">
  主机上唯一的部署 UID。
</ResponseField>

## 示例

```bash theme={null}
curl -s http://<pin-host>:8001/v1/agents/ag_7f8e9d0c \
  -H "Authorization: Bearer $ARIA_PIN_KEY"
```

```json theme={null}
{
  "id": "ag_7f8e9d0c",
  "name": "training-agent",
  "gpu_count": 8,
  "gpu_mem_gb": 640,
  "labels": ["training", "a100"],
  "gpus": [
    {
      "index": 0,
      "model": "NVIDIA A100",
      "mem_total_gb": 80,
      "mem_used_gb": 12.5,
      "slots": 1,
      "used_slots": 1
    }
  ],
  "last_heartbeat": "2024-05-10T14:30:00Z",
  "status": "online",
  "node_id": "gn_a1b2c3d4",
  "version": "1.2.0",
  "deploy_state": "deployed",
  "last_error": "",
  "agent_uid": "aria-agent-7f8e9d0c"
}
```

检索特定智能体的详细信息。响应包含 GPU 清单、最近心跳、状态、版本、部署状态以及所属节点的绑定关系。

## 接口

**GET** `/v1/agents/:id`

认证：需要 Bearer API 密钥。

## 路径参数

<ParamField path="id" type="string" required>
  智能体标识符，例如 ag\_7f8e9d0c。
</ParamField>

## 响应

<ResponseField name="id" type="string" required>
  智能体标识符。
</ResponseField>

<ResponseField name="name" type="string" required>
  智能体名称。
</ResponseField>

<ResponseField name="gpu_count" type="integer">
  GPU 总数。
</ResponseField>

<ResponseField name="gpu_mem_gb" type="number">
  GPU 总显存，以 GB 为单位。
</ResponseField>

<ResponseField name="labels" type="array of strings">
  调度标签。
</ResponseField>

<ResponseField name="gpus" type="array">
  每块 GPU 的详情：index、model、mem\_total\_gb、mem\_used\_gb、slots、used\_slots。
</ResponseField>

<ResponseField name="last_heartbeat" type="string (ISO 8601)">
  最近一次心跳时间戳。
</ResponseField>

<ResponseField name="status" type="string">
  智能体状态，例如 online。
</ResponseField>

<ResponseField name="node_id" type="string">
  所属 GPU 节点标识符。
</ResponseField>

<ResponseField name="version" type="string">
  智能体二进制版本。
</ResponseField>

<ResponseField name="deploy_state" type="string">
  部署状态，例如 deployed 或 updating。
</ResponseField>

<ResponseField name="last_error" type="string">
  最近一次部署或操作错误（若有）。
</ResponseField>

<ResponseField name="agent_uid" type="string">
  主机上唯一的部署 UID。
</ResponseField>

## 示例

```bash theme={null}
curl -s http://<pin-host>:8001/v1/agents/ag_7f8e9d0c \
  -H "Authorization: Bearer $ARIA_PIN_KEY"
```

```json theme={null}
{
  "id": "ag_7f8e9d0c",
  "name": "training-agent",
  "gpu_count": 8,
  "gpu_mem_gb": 640,
  "labels": ["training", "a100"],
  "gpus": [
    {
      "index": 0,
      "model": "NVIDIA A100",
      "mem_total_gb": 80,
      "mem_used_gb": 12.5,
      "slots": 1,
      "used_slots": 1
    }
  ],
  "last_heartbeat": "2024-05-10T14:30:00Z",
  "status": "online",
  "node_id": "gn_a1b2c3d4",
  "version": "1.2.0",
  "deploy_state": "deployed",
  "last_error": "",
  "agent_uid": "aria-agent-7f8e9d0c"
}
```
