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

# GET /v1/models — HHAPI 模型列表接口：查询可用模型 ID 与元数据响应字段说明

> GET /v1/models 返回 HHAPI 当前所有可用模型，每个模型包含 id、object、created 和 owned_by 字段。适用于在调用对话接口前动态获取合法模型 ID。created 与 owned_by 的具体取值待确认，以实际 API 响应为准。

`GET /v1/models` 接口用于查询 HHAPI 当前平台上所有可用模型的列表。返回结果包含每个模型的唯一标识符（`id`）及基本元数据，适用于在调用对话接口之前动态获取合法的模型 ID，或在界面中展示可选模型供用户选择。

<Note>
  **接口信息**

  * **方法**：`GET`
  * **路径**：`/v1/models`
  * **鉴权**：必需（Bearer Token）
</Note>

## 请求参数

此接口无必需请求参数，也无可选查询参数，直接携带鉴权头发起请求即可。

## 请求示例

以下示例从环境变量读取 API Key 和 Base URL：

```bash theme={null}
curl "$API_BASE_URL/v1/models" \
  -H "Authorization: Bearer $HHAPI_API_KEY"
```

## 响应字段

<ResponseField name="object" type="string">
  固定值 `"list"`，表示返回的是一个列表对象。
</ResponseField>

<ResponseField name="data" type="array">
  模型对象数组，每个元素代表一个可用模型。
</ResponseField>

<ResponseField name="data[].id" type="string">
  模型的唯一标识符，在调用 `/v1/chat/completions` 等接口时通过 `model` 字段传入此值。
</ResponseField>

<ResponseField name="data[].object" type="string">
  固定值 `"model"`，表示该对象类型为模型。
</ResponseField>

<ResponseField name="data[].created" type="integer">
  模型的创建时间戳（Unix 秒级时间戳）。**注意：具体数值待确认，部分模型可能返回占位值 `0`。**
</ResponseField>

<ResponseField name="data[].owned_by" type="string">
  模型所属提供方的标识。**注意：具体取值待确认，当前可能返回 `"hhapi"` 或上游提供方名称。**
</ResponseField>

## 响应示例

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "<MODEL_ID>",
      "object": "model",
      "created": 0,
      "owned_by": "hhapi"
    }
  ]
}
```

## 错误情况

| 状态码 | 含义 | 处理建议 |
| - | - | - |
| `401` | 未鉴权或 API Key 无效 | 检查 `Authorization` 请求头是否正确携带 |

完整的错误码说明请参阅 [错误响应说明](/api-reference/errors)。
