1. 接口描述
接口请求域名: tokenhub.tencentcloudapi.com 。
根据 API 密钥 ID 或密钥值查询 API 密钥详情,返回明文密钥。ApiKeyId 和 ApiKey 至少需传入其一,优先使用 ApiKeyId。
默认接口请求频率限制:20次/秒。
推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。
2. 输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| Action | 是 | String | 公共参数,本接口取值:DescribeApiKey。 |
| Version | 是 | String | 公共参数,本接口取值:2026-03-22。 |
| Region | 是 | String | 公共参数,详见产品支持的 地域列表。 |
| Platform | 是 | String | 平台类型。当前支持填值:maas 示例值:maas |
| ApiKeyId | 否 | String | API 密钥 ID,与 ApiKey 至少需传入其一,优先使用 ApiKeyId。 示例值:ak-20260320-a1b2c3d4 |
| ApiKey | 否 | String | API 密钥明文,与 ApiKeyId 至少需传入其一。 示例值:sk-xxx |
3. 输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| ApiKeyId | String | API 密钥 ID。 示例值:ak-20260320-a1b2c3d4 |
| Name | String | 名称。 示例值:my-api-key |
| ApiKey | String | API 密钥值(明文)。 示例值:sk-abcdefghijklmnopqrstuvwxyz123456 |
| Remark | String | 备注。 示例值:test api key |
| Platform | String | 平台类型。枚举:maas 示例值:maas |
| Uin | String | 主账号。 示例值:100000000001 |
| SubUin | String | 子账号。 示例值:100000000002 |
| Status | String | 状态。取值:enable(启用)、disable(禁用)。 示例值:enable |
| BindType | String | 绑定类型。取值:all(全部模型和接入点)、model_all_endpoint_custom(全部模型+自定义接入点)、model_custom_endpoint_all(自定义模型+全部接入点)、model_custom_endpoint_custom(自定义模型+自定义接入点)。 示例值:all |
| CreateTime | String | 创建时间。格式:YYYY-MM-DD HH:mm:ss。 示例值:2026-03-01 00:00:00 |
| UpdateTime | String | 更新时间。格式:YYYY-MM-DD HH:mm:ss。 示例值:2026-03-01 00:00:00 |
| AppId | String | 应用 ID。 示例值:1300000001 |
| Editable | Boolean | 是否可编辑。true 表示可编辑,false 表示不可编辑。 示例值:true |
| BindingItems | Array of BindingItem | 绑定资源列表,区分 endpoint 和 model 类型。 |
| IpWhitelist | Array of String | IP 白名单列表。支持 IPv4和 CIDR 格式。空数组表示不限制 IP。 示例值:["1.1.1.1"] |
| Creator | String | 当Platform为maas时该字段为空 示例值:张三 |
| RequestId | String | 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 |
4. 示例
示例1 输入ApiKeyId查询 API 密钥详情
输入ApiKeyId查询 API 密钥详情
输入示例
POST / HTTP/1.1
Host: tokenhub.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeApiKey
<公共请求参数>
{
"Platform": "maas",
"ApiKeyId": "ak-20260325-xxxxxx"
}
输出示例
{
"Response": {
"ApiKey": "sk-xxxxxx",
"ApiKeyId": "ak-20260325-xxxxxx",
"AppId": "111111",
"BindType": "model_custom_endpoint_custom",
"BindingItems": [
{
"ResourceId": "deepseek-v3.2",
"ResourceType": "model"
}
],
"CreateTime": "2026-03-25 19:50:56",
"Creator": "",
"Editable": true,
"Name": "my-apikey",
"Platform": "maas",
"Remark": "test-new-remark",
"RequestId": "b56014db-c0e2-4a0f-b2dc-0155684771ac",
"Status": "disable",
"SubUin": "112233",
"Uin": "112233",
"UpdateTime": "2026-03-25 20:43:53"
}
}
5. 开发者资源
腾讯云 API 平台
腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。
API Inspector
用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。
SDK
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
- Tencent Cloud SDK 3.0 for Python: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Java: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for PHP: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Go: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Node.js: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for .NET: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for C++: CNB, GitHub, Gitee
- Tencent Cloud SDK 3.0 for Ruby: CNB, GitHub, Gitee
命令行工具
6. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
| 错误码 | 描述 |
|---|---|
| InternalError.InternalError | InternalError.InternalError |
| InvalidParameter.InvalidParameter | InvalidParameter.InvalidParameter |
| InvalidParameterValue.InvalidParameterValue | InvalidParameterValue.InvalidParameterValue |
| MissingParameter.MissingParameter | MissingParameter.MissingParameter |
| ResourceNotFound | 资源不存在。 |
| UnauthorizedOperation.UnauthorizedOperation | UnauthorizedOperation.UnauthorizedOperation |