审核日志
此组织内的用户作和配置更改的日志。 要记录事件,您必须在 Organization Settings (组织设置) 中激活日志记录。 激活后,出于安全原因,无法停用日志记录。
列出审核日志
获取 https://api.openai.com/v1/organization/audit_logs
列出此组织内的用户作和配置更改。
查询参数
仅返回type
在其中一个值中。例如project.created
.有关所有选项,请参阅审核日志对象的文档。
用于分页的游标。after
是定义您在列表中的位置的对象 ID。例如,如果您发出列表请求并收到 100 个对象,以 obj_foo 结尾,则您的后续调用可以包含 after=obj_foo 以便获取列表的下一页。
返回
分页的 Audit Log 对象列表。
示例请求
1
2
3
curl https://api.openai.com/v1/organization/audit_logs \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"
响应
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
"object": "list",
"data": [
{
"id": "audit_log-xxx_yyyymmdd",
"type": "project.archived",
"effective_at": 1722461446,
"actor": {
"type": "api_key",
"api_key": {
"type": "user",
"user": {
"id": "user-xxx",
"email": "user@example.com"
}
}
},
"project.archived": {
"id": "proj_abc"
},
},
{
"id": "audit_log-yyy__20240101",
"type": "api_key.updated",
"effective_at": 1720804190,
"actor": {
"type": "session",
"session": {
"user": {
"id": "user-xxx",
"email": "user@example.com"
},
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
}
},
"api_key.updated": {
"id": "key_xxxx",
"data": {
"scopes": ["resource_2.operation_2"]
}
},
}
],
"first_id": "audit_log-xxx__20240101",
"last_id": "audit_log_yyy__20240101",
"has_more": true
}
审核日志对象
此组织内的用户作或配置更改的日志。
OBJECT 审核日志对象
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"id": "req_xxx_20240101",
"type": "api_key.created",
"effective_at": 1720804090,
"actor": {
"type": "session",
"session": {
"user": {
"id": "user-xxx",
"email": "user@example.com"
},
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
}
},
"api_key.created": {
"id": "key_xxxx",
"data": {
"scopes": ["resource.operation"]
}
}
}