获取 API Key
GET /api/v1/gateway/keys/{key_id}
返回单个 Key 的详细配置(不含完整 Key 明文)。
鉴权:本接口属于控制台后端 API(Base URL
https://portal.aiin1.ai,注意不是api.portal.aiin1.ai),需携带控制台账号登录后获取的access_token(15 分钟有效),不能使用sk-nex-API 令牌。登录方式见 账单对账与用量自动同步。
请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
key_id |
path | string(uuid) | 是 | Key ID |
请求示例
curl -X GET https://portal.aiin1.ai/api/v1/gateway/keys/KEY_ID \
-H "Authorization: Bearer $ACCESS_TOKEN"响应
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id |
string(uuid) | 是 | Key ID |
org_id |
string(uuid) | 是 | 组织 ID |
team_id |
string | null | 否 | 所属团队 ID |
name |
string | 是 | Key 名称 |
key |
string | null | 否 | 完整 Key,仅创建 / 轮换时返回一次 |
key_prefix |
string | 是 | Key 前缀(列表展示用) |
models_allowed |
array<string> | 是 | 可用模型白名单(空数组 = 不限制) |
rpm_limit |
integer | 是 | 每分钟请求数上限 |
tpm_limit |
integer | 是 | 每分钟 token 上限 |
is_sandbox |
boolean | 是 | 是否沙箱 Key |
allowed_ips |
array | null | 否 | IP 白名单(null = 不限制) |
spending_limit_usd |
string | null | 否 | 累计消费上限(USD),null = 不限 |
expires_at |
string | null | 否 | 过期时间 |
rotate_grace_until |
string | null | 否 | 轮换后旧 Key 的宽限期截止时间 |
status |
string | 是 | 状态 |
created_at |
string(datetime) | 是 | 创建时间 |