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

# 创建 API 密钥

> 在 UQPAY 商户后台生成 API 凭证，用于认证 API 请求。

每次向 UQPAY 发起 API 请求都需要两项凭证：**Client ID**（公开标识）和 **API Key**（密钥）。两者都在商户后台生成。

**1. 打开 API Keys**

登录商户后台，在侧边栏底部打开 **Developers**，然后选择 **API Keys**。

Developers 菜单仅对拥有开发者读取权限的主账户开放。

**2. 创建 API 密钥**

选择 **Create API Key**。填写密钥名称，添加允许使用该密钥的 IP 地址或 CIDR 网段，并只授予集成所需的权限范围。

> [!TIP]
>
> 后续可以修改密钥名称、IP 白名单和权限范围，无需轮换密钥。

**3. 复制并保存 API Key**

创建密钥后，从确认对话框复制 API Key。

> [!WARNING]
>
> API Key **只显示一次**。请立即复制并安全保存；如果丢失，需要创建新的密钥。

**4. 查找 Client ID**

返回 API Keys 列表。Client ID 会持续显示在表格中，可随时复制。

> [!NOTE]
>
> 只有主账户可以生成 API 密钥。如需代表子账户调用 API，请使用 `x-on-behalf-of` 请求头，详见[关联账户](https://developers-sandbox.uqpaytech.com/docs/zh/account-center/v1.6/guide/connected-accounts.md)。

## 下一步

获取 Client ID 和 API Key 后，请阅读[快速开始](https://developers-sandbox.uqpaytech.com/docs/zh/account-center/v1.6/guide/quickstart.md)，发起第一个 API 请求。


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