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

# 我的密钥列表

> 列出我存放的上游凭证密钥，只返回名称与掩码。

## 端点

```
GET https://api-datahub.bazhuayu.com/v1/secrets
```

认证：需要 API Key（`Authorization: Bearer <API Key>`）。

只返回名称与掩码。明文一旦写入，任何端点都不再回显；忘记了就重新设置一次。

密钥是 App 作者为自己发布的 App 存放的上游凭证（例如第三方接口的 API Key），在 manifest 的 `runtime.env` 里按名称引用；同一发布者的多个 App 可以共用一个名称。

## 请求

### 示例请求

```bash theme={null}
curl \
  -H "Authorization: Bearer $BAZHUAYU_API_KEY" \
  "https://api-datahub.bazhuayu.com/v1/secrets"
```

## 响应

### 200 成功

```json theme={null}
{
  "data": {
    "items": [
      {
        "name": "EXAMPLE_API_KEY",
        "masked": "********mple",
        "scope": "publisher",
        "created_at": "2026-09-15T07:45:42.285442+00:00",
        "updated_at": "2026-09-15T07:45:42.285442+00:00"
      },
      {
        "name": "PARTNER_API_BASE",
        "masked": "********5551",
        "scope": "publisher",
        "created_at": "2026-09-15T07:45:38.604443+00:00",
        "updated_at": "2026-09-15T07:45:38.604443+00:00"
      },
      "…"
    ]
  }
}
```

响应包在 `data` 字段中，其内容如下。

<ResponseField name="items" type="object[]" required>
  密钥列表。

  <Expandable title="字段">
    <ResponseField name="name" type="string" required>
      名称，也是 manifest 里引用的名字。
    </ResponseField>

    <ResponseField name="masked" type="string" required>
      掩码后的值，只露最后几位。
    </ResponseField>

    <ResponseField name="scope" type="string">
      作用域，当前固定为 `publisher`。
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      创建时间。
    </ResponseField>

    <ResponseField name="updated_at" type="string" required>
      最近更新时间。
    </ResponseField>
  </Expandable>
</ResponseField>

### 错误

| HTTP | `code` | `category` | 说明 |
| - | - | - | - |
| 401 | `unauthorized` | `forbidden` | 缺少或无效的 API Key。 |

错误响应统一为 `{"error": {code, category, message, retryable}}`，见<a href="/docs/zh/datahub/api/reference/introduction#错误" target="_blank" rel="noopener noreferrer">错误</a>。

## 客户端库

Python 与 JavaScript SDK 暂未封装此端点，请直接调用 REST。


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