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

# 查询 API Key 网络访问策略

查询单个 API Key 当前的网络访问策略，即该 Key 允许的来源 IP 列表。如果该 Key 从未配置过，返回空列表，表示不限制来源 IP。

> [!NOTE]
>
> 网络访问策略仅作用于模型调用接口。请求来源 IP 不在允许列表内时，模型调用会被拒绝；平台管理类接口（包含本组网络访问读写接口、账单查询等）不受来源 IP 限制。

## 权限

| 角色 | 是否可查询 |
| :- | :- |
| 所有者 / 管理员 | 可查询团队内任意 API Key 的网络访问策略。 |
| 开发者 | 只能查询自己创建的 API Key。 |
| 基础用户 | 只能查询自己创建的 API Key。 |
| 财务管理员 | 可查询团队内任意 API Key 的网络访问策略。 |

被查询的 API Key 必须属于当前调用方所在的团队。查询无权限或不属于本团队的 Key 时，接口不会暴露目标 Key 是否存在，一律按无权限处理。

## 请求头

**Authorization** `string` *required*

Bearer 身份验证格式，例如：Bearer \{\{API 密钥}}。

## 路径参数

**stringId** `string` *required*

目标 API Key 的 stringId。

## 响应参数

**stringId** `string` *required*

API Key 的 stringId。

**policy** `object` *required*

网络访问策略对象。

**properties**

**allowedIps** `string[]` *required*

允许的来源 IP 列表，每项为 IPv4 地址或 IPv4 CIDR 网段。空列表表示不限制来源 IP。

**policyStatus** `string` *required*

策略状态。取值 `active`。

**allowedIpCount** `int` *required*

允许的 IP 条目数。`0` 表示不限制来源 IP。

**updatedAt** `string` *required*

最近一次更新时间，ISO 8601 格式。从未配置时为空字符串。

**updatedBy** `string` *required*

最近一次更新操作者的用户 UUID。从未配置时为空字符串。

```bash theme={null}
curl --request GET \
  --url https://api.highwayapi.ai/openapi/v2/user/key/<stringId>/ip-access-policy \
  --header 'Authorization: Bearer <API_KEY>'
```

```json 200 (已配置允许的 IP) theme={null}
{
  "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"
}
```

```json 200 (未配置，不限制来源 IP) theme={null}
{
  "stringId": "key_xxx",
  "policy": {
    "allowedIps": []
  },
  "policyStatus": "active",
  "allowedIpCount": 0,
  "updatedAt": "",
  "updatedBy": ""
}
```


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