curl --request GET \
--url https://api.ppio.com/openapi/v2/user/key/<stringId>/ip-access-policy \
--header 'Authorization: Bearer <API_KEY>'
{
"stringId": "key_xxx",
"policy": {
"allowedIps": ["203.0.113.5", "198.51.100.0/24"]
},
"policyStatus": "active",
"allowedIpCount": 2,
"updatedAt": "2026-08-13T10:20:30Z",
"updatedBy": "a3f1c9e2-5b7d-4e81-9c34-2f6a8d0b1e57"
}
{
"stringId": "key_xxx",
"policy": {
"allowedIps": []
},
"policyStatus": "active",
"allowedIpCount": 0,
"updatedAt": "",
"updatedBy": ""
}
API Key 网络访问
查询 API Key 网络访问策略
GET
/
openapi
/
v2
/
user
/
key
/
{stringId}
/
ip-access-policy
curl --request GET \
--url https://api.ppio.com/openapi/v2/user/key/<stringId>/ip-access-policy \
--header 'Authorization: Bearer <API_KEY>'
{
"stringId": "key_xxx",
"policy": {
"allowedIps": ["203.0.113.5", "198.51.100.0/24"]
},
"policyStatus": "active",
"allowedIpCount": 2,
"updatedAt": "2026-08-13T10:20:30Z",
"updatedBy": "a3f1c9e2-5b7d-4e81-9c34-2f6a8d0b1e57"
}
{
"stringId": "key_xxx",
"policy": {
"allowedIps": []
},
"policyStatus": "active",
"allowedIpCount": 0,
"updatedAt": "",
"updatedBy": ""
}
查询单个 API Key 当前的网络访问策略,即该 Key 允许的来源 IP 列表。如果该 Key 从未配置过,返回空列表,表示不限制来源 IP。
被查询的 API Key 必须属于当前调用方所在的团队。查询无权限或不属于本团队的 Key 时,接口不会暴露目标 Key 是否存在,一律按无权限处理。
网络访问策略仅作用于模型调用接口。请求来源 IP 不在允许列表内时,模型调用会被拒绝;平台管理类接口(包含本组网络访问读写接口、账单查询、Sandbox 等)不受来源 IP 限制。
权限
| 角色 | 是否可查询 |
|---|---|
| Owner / Admin | 可查询团队内任意 API Key 的网络访问策略。 |
| Developer | 只能查询自己创建的 API Key。 |
| 基础用户 | 只能查询自己创建的 API Key。 |
| 财务管理员 | 可查询团队内任意 API Key 的网络访问策略。 |
请求头
string
必填
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
路径参数
string
必填
目标 API Key 的 stringId。
响应参数
string
必填
API Key 的 stringId。
string
必填
策略状态。取值
active。int
必填
允许的 IP 条目数。
0 表示不限制来源 IP。string
必填
最近一次更新时间,ISO 8601 格式。从未配置时为空字符串。
string
必填
最近一次更新操作者的用户 UUID。从未配置时为空字符串。
curl --request GET \
--url https://api.ppio.com/openapi/v2/user/key/<stringId>/ip-access-policy \
--header 'Authorization: Bearer <API_KEY>'
{
"stringId": "key_xxx",
"policy": {
"allowedIps": ["203.0.113.5", "198.51.100.0/24"]
},
"policyStatus": "active",
"allowedIpCount": 2,
"updatedAt": "2026-08-13T10:20:30Z",
"updatedBy": "a3f1c9e2-5b7d-4e81-9c34-2f6a8d0b1e57"
}
{
"stringId": "key_xxx",
"policy": {
"allowedIps": []
},
"policyStatus": "active",
"allowedIpCount": 0,
"updatedAt": "",
"updatedBy": ""
}
最后修改于 2026年8月27日