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

获取指定时间范围内，企业的 OpenAPI 调用日志。该接口的响应数据为分页格式。
## 所需权限 {#b7a721fe}
`audit`
## 请求方式 {#a7892641}
```HTTP
GET /openapi/v1/audit/openapi-logs
```

## 请求参数 {#6d5dc98e}
<!-- @cols-width: 146,146,146,146,282 -->
| | | | | | \
|**参数** |**类型** |**是否必填** |**默认值** |**描述** |
|---|---|---|---|---|
| | | | | | \
|`start_time` |int |是 |\- |开始时间（秒时间戳）。 |
| | | | | | \
|`end_time` |int |是 |\- |结束时间（秒时间戳）。时间跨度最大为 90 天。 |
| | | | | | \
|`page` |int |否 |`1` |需要获取的页数。 |
| | | | | | \
|`page_size` |int |否 |`50` |每页返回的日志条数，最多 200 条。 |
| | | | | | \
|`source_ip` |string |否 |\- |按来源 IP 过滤日志。 |
| | | | | | \
|`api_path` |string |否 |\- |按 API 路径过滤日志。 |

## 响应参数 {#228eaa1d}
<!-- @cols-width: 244,244,356 -->
| | | | \
|**参数** |**类型** |**描述** |
|---|---|---|
| | | | \
|`items` |array |当前页返回的 OpenAPI 调用日志列表。 |
| | | | \
|`pagination` |object |分页信息，用于控制翻页。 |

`items` 数组包含以下参数：
<!-- @cols-width: 244,244,244 -->
| | | | \
|**参数** |**类型** |**描述** |
|---|---|---|
| | | | \
|`log_id` |string |日志 ID。 |
| | | | \
|`app_id` |string |脱敏后的应用 ID。 |
| | | | \
|`api_path` |string |请求路径。 |
| | | | \
|`http_method` |string |HTTP 方法。 |
| | | | \
|`source_ip` |string |来源 IP。 |
| | | | \
|`status_code` |int |HTTP 响应状态码。 |
| | | | \
|`operation_time` |int64 |调用时间（秒时间戳）。 |

`pagination` 对象包含以下参数：
<!-- @cols-width: 190,141,321 -->
| | | | \
|**参数** |**类型** |**描述** |
|---|---|---|
| | | | \
|page |int |当前页码。 |
| | | | \
|page_size |int |每页的日志条数。 |
| | | | \
|total |int |日志总条数。 |
| | | | \
|total_pages |int |总页数。 |

## 请求示例 {#0349f0cc}
```Bash
curl -X GET "https://{domain}/openapi/v1/audit/openapi-logs?start_time=1700000000&end_time=1700086400&page=1&page_size=50" \
  -H "Authorization: Bearer {access_token}"
```

## 响应示例 {#bc67d506}
```JSON
{
  "code": 0,
  "message": "success",
  "request_id": "req_abc123xyz",
  "data": {
    "items": [
      {
        "log_id": "123",
        "app_id": "AK1234****5678",
        "api_path": "/openapi/v1/users",
        "http_method": "GET",
        "source_ip": "1.2.3.4",
        "status_code": 200,
        "operation_time": 1700000000
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 50,
      "total": 100,
      "total_pages": 2
    }
  }
}
```

