OpenAI 列出审计日志

2026-11-13 11:20 更新

列出审计日志

get /organization/audit_logs

列出此组织内的用户操作和配置变更。 字段类型说明:optional 表示可选,array of 表示数组元素类型,or 表示可选类型或值,default 表示默认值;string、integer、boolean、object、unknown 分别表示字符串、整数、布尔值、对象和未限定类型。

查询参数

  • "actor_emails[]": optional array of string

仅返回由这些电子邮件地址对应的用户执行的事件。

  • "actor_ids[]": optional array of string

仅返回由这些执行者执行的事件。可以是用户 ID、服务账号 ID 或 API 密钥跟踪 ID。

  • after: optional string 分页游标。after 是标记当前列表位置的对象 ID。例如,列表请求返回了 100 个对象,最后一个对象为 obj_foo;后续调用可传入 after=obj_foo,以获取下一页。

  • before: optional string 分页游标。before 是标记当前列表位置的对象 ID。例如,列表请求返回了 100 个对象,第一个对象为 obj_foo;后续调用可传入 before=obj_foo,以获取上一页。

  • effective_at: optional object { gt, gte, lt, lte }

仅返回 effective_at(Unix 时间戳,单位为秒)处于此范围内的事件。

  • gt: optional integer 仅返回 effective_at(Unix 时间戳,单位为秒)大于此值的事件。

  • gte: optional integer

仅返回 effective_at(Unix 时间戳,单位为秒)大于或等于此值的事件。

  • lt: optional integer

仅返回 effective_at(Unix 时间戳,单位为秒)小于此值的事件。

  • lte: optional integer

仅返回 effective_at(Unix 时间戳,单位为秒)小于或等于此值的事件。

  • "event_types[]": optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 146 more

仅返回 type 属于所列值的事件,例如 project.created。所有选项见审计日志对象文档。

  • "api_key.created"

  • "api_key.updated"

  • "api_key.deleted"

  • "certificate.created"

  • "certificate.updated"
  • "certificate.deleted"

  • "certificates.activated"

  • "certificates.deactivated"

  • "checkpoint.permission.created"

  • "checkpoint.permission.deleted"

  • "external_key.registered"

  • "external_key.removed"

  • "external_storage.registered"

  • "external_storage.removed"

  • "group.created"

  • "group.updated"

  • "group.deleted"

  • "invite.sent"

  • "invite.accepted"

  • "invite.deleted"

  • "ip_allowlist.created"

  • "ip_allowlist.updated"
  • "ip_allowlist.deleted"

  • "ip_allowlist.config.activated"

  • "ip_allowlist.config.deactivated"

  • "login.succeeded"

  • "login.failed"

  • "logout.succeeded"

  • "logout.failed"

  • "organization.updated"

  • "project.created"

  • "project.updated"

  • "project.archived"

  • "project.deleted"

  • "rate_limit.updated"

  • "rate_limit.deleted"

  • "resource.deleted"

  • "tunnel.created"

  • "tunnel.updated"

  • "tunnel.deleted"
  • "workload_identity_provider.created"

  • "workload_identity_provider.updated"

  • "workload_identity_provider.deleted"

  • "workload_identity_provider_mapping.created"

  • "workload_identity_provider_mapping.updated"

  • "workload_identity_provider_mapping.deleted"

  • "role.created"

  • "role.updated"

  • "role.deleted"

  • "role.assignment.created"

  • "role.assignment.deleted"

  • "role.bound_to_resource"

  • "role.unbound_from_resource"

  • "scim.enabled"
  • "scim.disabled"

  • "service_account.created"

  • "service_account.updated"

  • "service_account.deleted"

  • "user.added"

  • "user.updated"

  • "user.deleted"

  • "tenant.metadata.updated"

  • "tenant.microsoft_entra_mapping.upserted"

  • "tenant.microsoft_entra_mapping.deleted"

  • "tenant.workload_identity.provider.created"

  • "tenant.workload_identity.provider.updated"

  • "tenant.workload_identity.provider.archived"
  • "tenant.workload_identity.mapping.created"

  • "tenant.workload_identity.mapping.updated"

  • "tenant.workload_identity.mapping.archived"

  • "tenant.workload_identity.binding.created"

  • "tenant.workload_identity.principal.provisioned"

  • "tenant.workload_identity.access_token.issued"

  • "tenant.admin_api_key.created"

  • "tenant.admin_api_key.updated"

  • "tenant.admin_api_key.deleted"

  • "tenant.project_api_key.created"
  • "tenant.trusted_access.business_verification.started"

  • "tenant.trusted_access.application.submitted"

  • "tenant.chatgpt_access_token.revoked"

  • "tenant.migration.completed"

  • "tenant.sso.migrated"

  • "tenant.domains.migrated"

  • "tenant.sso_connection.created"

  • "tenant.sso_connection.updated"

  • "tenant.sso_connection.deleted"

  • "tenant.sso_connection.setup.started"

  • "tenant.policy.created"

  • "tenant.policy.updated"

  • "tenant.policy.deleted"
  • "tenant.policy.attached"

  • "tenant.policy.detached"

  • "tenant.principal_authentication_policy.resolved"

  • "tenant.scim.setup.started"

  • "tenant.scim.deletion.requested"

  • "tenant.scim.directory.created"

  • "tenant.product_access_policy.updated"

  • "tenant.resource_share_grant.created"

  • "tenant.resource_share_grant.updated"

  • "tenant.resource_share_grant.accepted"

  • "tenant.resource_share_grant.declined"

  • "tenant.resource_share_grant.revoked"
  • "tenant.resource_share_grant.deleted"

  • "tenant.service_account.updated"

  • "tenant.service_account.deleted"

  • "tenant.service_account.token.revoked"

  • "tenant.billing.overage_limit.updated"

  • "tenant.billing.alerts.updated"

  • "tenant.billing.info.updated"

  • "tenant.usage_limit.workspace.updated"

  • "tenant.usage_limit.group.updated"

  • "tenant.usage_limit.user.updated"

  • "tenant.usage_limit.increase_request.updated"
  • "tenant.usage_limit.increase_request.resolved"

  • "tenant.group.created"

  • "tenant.group.updated"

  • "tenant.group.deleted"

  • "tenant.group.member.added"

  • "tenant.group.member.removed"

  • "tenant.migration_rollout.status.updated"

  • "tenant.migration_rollout.tier.updated"

  • "tenant.role.metadata.updated"

  • "tenant.custom_role.created"

  • "tenant.custom_role.updated"

  • "tenant.custom_role.deleted"

  • "tenant.role_assignment.created"
  • "tenant.role_assignment.deleted"

  • "tenant.resource_role_assignment.created"

  • "tenant.resource_role_assignment.deleted"

  • "tenant.resource_access.updated"

  • "tenant.resource_access.deleted"

  • "tenant.ads_account.onboarding.redemption"

  • "tenant.session_policy.created"

  • "tenant.session_policy.updated"

  • "tenant.session_policy.deleted"

  • "tenant.session_revocation.started"

  • "tenant.third_party_app_policy.updated"

  • "tenant.user.added"
  • "tenant.user.updated"

  • "tenant.user.removed"

  • "tenant.user.looked_up"

  • "tenant.user.invited"

  • "tenant.membership.revoked"

  • "tenant.api_organization_invite.upserted"

  • "tenant.api_organization_invite.deleted"

  • "tenant.chatgpt_workspace_invite.upserted"

  • "tenant.membership.accepted"

  • "tenant.membership.declined"

  • "tenant.workspace_invite_email_settings.updated"

  • limit: optional integer (default: 20) 返回的对象数量上限。取值范围为 1 至 100,默认值为 20。

  • "project_ids[]": optional array of string

仅返回这些项目的事件。

  • "resource_ids[]": optional array of string

仅返回对这些目标执行的事件,例如被更新的项目 ID。对于 ChatGPT 连接器角色事件,请使用 details.id 中显示的工作区连接器资源 ID,例如 <workspace_id>__<connector_id>。

  • tenant_only: optional boolean (default: false)

仅返回与此组织关联的租户范围事件。查询 role.bound_to_resource 和 role.unbound_from_resource 等租户范围事件时,必须使用此参数。设为 true 时,提供的所有事件类型都必须属于租户范围。

返回值

  • data: array of object { id, effective_at, type, 59 more }

  • id: string

此日志的 ID。

  • effective_at: integer

事件的 Unix 时间戳,单位为秒。

format: unixtime

  • type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 146 more

事件类型。

  • "api_key.created"

  • "api_key.updated"

  • "api_key.deleted"

  • "certificate.created"

  • "certificate.updated"

  • "certificate.deleted"
  • "certificates.activated"

  • "certificates.deactivated"

  • "checkpoint.permission.created"

  • "checkpoint.permission.deleted"

  • "external_key.registered"

  • "external_key.removed"

  • "external_storage.registered"

  • "external_storage.removed"

  • "group.created"

  • "group.updated"

  • "group.deleted"

  • "invite.sent"

  • "invite.accepted"

  • "invite.deleted"

  • "ip_allowlist.created"

  • "ip_allowlist.updated"
  • "ip_allowlist.deleted"

  • "ip_allowlist.config.activated"

  • "ip_allowlist.config.deactivated"

  • "login.succeeded"

  • "login.failed"

  • "logout.succeeded"

  • "logout.failed"

  • "organization.updated"

  • "project.created"

  • "project.updated"

  • "project.archived"

  • "project.deleted"

  • "rate_limit.updated"

  • "rate_limit.deleted"

  • "resource.deleted"

  • "tunnel.created"

  • "tunnel.updated"
  • "tunnel.deleted"

  • "workload_identity_provider.created"

  • "workload_identity_provider.updated"

  • "workload_identity_provider.deleted"

  • "workload_identity_provider_mapping.created"

  • "workload_identity_provider_mapping.updated"

  • "workload_identity_provider_mapping.deleted"

  • "role.created"

  • "role.updated"

  • "role.deleted"

  • "role.assignment.created"

  • "role.assignment.deleted"

  • "role.bound_to_resource"
  • "role.unbound_from_resource"

  • "scim.enabled"

  • "scim.disabled"

  • "service_account.created"

  • "service_account.updated"

  • "service_account.deleted"

  • "user.added"

  • "user.updated"

  • "user.deleted"

  • "tenant.metadata.updated"

  • "tenant.microsoft_entra_mapping.upserted"

  • "tenant.microsoft_entra_mapping.deleted"

  • "tenant.workload_identity.provider.created"

  • "tenant.workload_identity.provider.updated"
  • "tenant.workload_identity.provider.archived"

  • "tenant.workload_identity.mapping.created"

  • "tenant.workload_identity.mapping.updated"

  • "tenant.workload_identity.mapping.archived"

  • "tenant.workload_identity.binding.created"

  • "tenant.workload_identity.principal.provisioned"

  • "tenant.workload_identity.access_token.issued"

  • "tenant.admin_api_key.created"

  • "tenant.admin_api_key.updated"

  • "tenant.admin_api_key.deleted"
  • "tenant.project_api_key.created"

  • "tenant.trusted_access.business_verification.started"

  • "tenant.trusted_access.application.submitted"

  • "tenant.chatgpt_access_token.revoked"

  • "tenant.migration.completed"

  • "tenant.sso.migrated"

  • "tenant.domains.migrated"

  • "tenant.sso_connection.created"

  • "tenant.sso_connection.updated"

  • "tenant.sso_connection.deleted"

  • "tenant.sso_connection.setup.started"
  • "tenant.policy.created"

  • "tenant.policy.updated"

  • "tenant.policy.deleted"

  • "tenant.policy.attached"

  • "tenant.policy.detached"

  • "tenant.principal_authentication_policy.resolved"

  • "tenant.scim.setup.started"

  • "tenant.scim.deletion.requested"

  • "tenant.scim.directory.created"

  • "tenant.product_access_policy.updated"

  • "tenant.resource_share_grant.created"

  • "tenant.resource_share_grant.updated"
  • "tenant.resource_share_grant.accepted"

  • "tenant.resource_share_grant.declined"

  • "tenant.resource_share_grant.revoked"

  • "tenant.resource_share_grant.deleted"

  • "tenant.service_account.updated"

  • "tenant.service_account.deleted"

  • "tenant.service_account.token.revoked"

  • "tenant.billing.overage_limit.updated"

  • "tenant.billing.alerts.updated"

  • "tenant.billing.info.updated"

  • "tenant.usage_limit.workspace.updated"
  • "tenant.usage_limit.group.updated"

  • "tenant.usage_limit.user.updated"

  • "tenant.usage_limit.increase_request.updated"

  • "tenant.usage_limit.increase_request.resolved"

  • "tenant.group.created"

  • "tenant.group.updated"

  • "tenant.group.deleted"

  • "tenant.group.member.added"

  • "tenant.group.member.removed"

  • "tenant.migration_rollout.status.updated"

  • "tenant.migration_rollout.tier.updated"

  • "tenant.role.metadata.updated"
  • "tenant.custom_role.created"

  • "tenant.custom_role.updated"

  • "tenant.custom_role.deleted"

  • "tenant.role_assignment.created"

  • "tenant.role_assignment.deleted"

  • "tenant.resource_role_assignment.created"

  • "tenant.resource_role_assignment.deleted"

  • "tenant.resource_access.updated"

  • "tenant.resource_access.deleted"

  • "tenant.ads_account.onboarding.redemption"

  • "tenant.session_policy.created"
  • "tenant.session_policy.updated"

  • "tenant.session_policy.deleted"

  • "tenant.session_revocation.started"

  • "tenant.third_party_app_policy.updated"

  • "tenant.user.added"

  • "tenant.user.updated"

  • "tenant.user.removed"

  • "tenant.user.looked_up"

  • "tenant.user.invited"

  • "tenant.membership.revoked"

  • "tenant.api_organization_invite.upserted"

  • "tenant.api_organization_invite.deleted"
  • "tenant.chatgpt_workspace_invite.upserted"

  • "tenant.membership.accepted"

  • "tenant.membership.declined"

  • "tenant.workspace_invite_email_settings.updated"

  • actor: optional object { api_key, session, type } or null

执行此审计日志所记录操作的执行者。

  • api_key: optional object { id, service_account, type, user }

执行此审计日志所记录操作时使用的 API 密钥。

  • id: optional string

API 密钥的跟踪 ID。

  • service_account: optional object { id }

执行此审计日志所记录操作的服务账号。

  • id: optional string

服务账号 ID。

  • type: optional "user" or "service_account"

API 密钥类型,可以是 user 或 service_account。

  • "user"

  • "service_account"

  • user: optional object { id, email }

执行此审计日志所记录操作的用户。

  • id: optional string 用户 ID。

  • email: optional string

用户的电子邮件地址。

  • session: optional object { ip_address, user }

执行此审计日志所记录操作时所在的会话。

  • ip_address: optional string

执行操作时使用的 IP 地址。

  • user: optional object { id, email }

执行此审计日志所记录操作的用户。

  • id: optional string

用户 ID。

  • email: optional string 用户的电子邮件地址。

  • type: optional "session" or "api_key"

执行者类型,可以是 session 或 api_key。

  • "session"

  • "api_key"

  • "api_key.created": optional object { id, data }

具有此 type 的事件的详细信息。

  • id: optional string

API 密钥的跟踪 ID。

  • data: optional object { scopes }

创建 API 密钥时使用的请求数据。

  • scopes: optional array of string API 密钥允许的作用域列表,例如 ["api.model.request"]。

  • "api_key.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

API 密钥的跟踪 ID。

  • "api_key.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

API 密钥的跟踪 ID。

  • changes_requested: optional object { expires_in_seconds, scopes } 更新 API 密钥时使用的请求数据。

  • expires_in_seconds: optional integer

从发出更新请求到 API 密钥过期的秒数。

  • scopes: optional array of string

API 密钥允许的作用域列表,例如 ["api.model.request"]。

  • "certificate.created": optional object { id, name }

具有此 type 的事件的详细信息。

  • id: optional string

证书 ID。

  • name: optional string 证书名称。

  • "certificate.deleted": optional object { id, certificate, name }

具有此 type 的事件的详细信息。

  • id: optional string

证书 ID。

  • certificate: optional string

PEM 格式的证书内容。

  • name: optional string

证书名称。

  • "certificate.updated": optional object { id, name }

具有此 type 的事件的详细信息。

  • id: optional string 证书 ID。

  • name: optional string

证书名称。

  • "certificates.activated": optional object { certificates }

具有此 type 的事件的详细信息。

  • certificates: optional array of object { id, name }

  • id: optional string

证书 ID。

  • name: optional string

证书名称。

  • "certificates.deactivated": optional object { certificates }

具有此 type 的事件的详细信息。

  • certificates: optional array of object { id, name }

  • id: optional string

证书 ID。

  • name: optional string

证书名称。

  • "checkpoint.permission.created": optional object { id, data }

创建此检查点权限所针对的项目和微调模型检查点。

  • id: optional string

检查点权限的 ID。

  • data: optional object { fine_tuned_model_checkpoint, project_id } 创建检查点权限时使用的请求数据。

  • fine_tuned_model_checkpoint: optional string

微调模型检查点的 ID。

  • project_id: optional string

创建此检查点权限所针对的项目 ID。

  • "checkpoint.permission.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

检查点权限的 ID。

  • "external_key.registered": optional object { id, data }

具有此 type 的事件的详细信息。

  • id: optional string

外部密钥配置的 ID。

  • data: optional unknown

外部密钥的配置。

  • "external_key.removed": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

外部密钥配置的 ID。

  • "external_storage.registered": optional object { id, data } 具有此 type 的事件的详细信息。

  • id: optional string

外部存储配置的 ID。

  • data: optional object { geography, provider }

外部存储的配置。

  • geography: optional string

根据存储区域推导出的 OpenAI 地理区域。

  • provider: optional AwsExternalStorageProvider or AzureExternalStorageProvider or GcpExternalStorageProvider or OciExternalStorageProvider 外部存储提供商的配置。

  • AwsExternalStorageProvider object { account_id, bucket, external_id, 3 more }

  • account_id: string

  • bucket: string

  • external_id: string

  • region: string

  • role_arn: string

  • type: "aws" (default: "aws")

  • "aws"

  • AzureExternalStorageProvider object { account_name, container, region, 4 more }

  • account_name: string
  • container: string

  • region: string

  • resource_group: string

  • subscription_id: string

  • tenant_id: string

  • type: "azure" (default: "azure")

  • "azure"

  • GcpExternalStorageProvider object { audience, bucket, region, 4 more }

  • audience: string

  • bucket: string

  • region: string

  • type: "gcp" (default: "gcp")

  • "gcp"
    • workload_identity_pool_id: string

  • workload_identity_project_number: string

  • workload_identity_provider_id: string

  • OciExternalStorageProvider object { bucket, region, tenancy_ocid, type }

  • bucket: string

  • region: string

  • tenancy_ocid: string

  • type: "oci" (default: "oci")

  • "oci"

  • "external_storage.removed": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

外部存储配置的 ID。

  • "group.created": optional object { id, data }

具有此 type 的事件的详细信息。

  • id: optional string

群组 ID。

  • data: optional object { group_name }

已创建群组的信息。

  • group_name: optional string

群组名称。

  • "group.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

群组 ID。

  • "group.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

群组 ID。

  • changes_requested: optional object { group_name }

更新群组时使用的请求数据。

  • group_name: optional string

更新后的群组名称。

  • "invite.accepted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

邀请 ID。

  • "invite.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

邀请 ID。

  • "invite.sent": optional object { id, data }

具有此 type 的事件的详细信息。

  • id: optional string

邀请 ID。

  • data: optional object { email, role }

创建邀请时使用的请求数据。

  • email: optional string 受邀加入组织的电子邮件地址。

  • role: optional string

邀请该电子邮件地址对应用户担任的角色,可以是 owner 或 member。

  • "ip_allowlist.config.activated": optional object { configs }

具有此 type 的事件的详细信息。

  • configs: optional array of object { id, name }

已激活的配置。

  • id: optional string

IP 允许列表配置的 ID。

  • name: optional string IP 允许列表配置的名称。

  • "ip_allowlist.config.deactivated": optional object { configs }

具有此 type 的事件的详细信息。

  • configs: optional array of object { id, name }

已停用的配置。

  • id: optional string

IP 允许列表配置的 ID。

  • name: optional string

IP 允许列表配置的名称。

  • "ip_allowlist.created": optional object { id, allowed_ips, name }

具有此 type 的事件的详细信息。

  • id: optional string

IP 允许列表配置的 ID。

  • allowed_ips: optional array of string

配置中包含的 IP 地址或 CIDR 范围。

  • name: optional string

IP 允许列表配置的名称。

  • "ip_allowlist.deleted": optional object { id, allowed_ips, name } 具有此 type 的事件的详细信息。

  • id: optional string

IP 允许列表配置的 ID。

  • allowed_ips: optional array of string

配置中原有的 IP 地址或 CIDR 范围。

  • name: optional string

IP 允许列表配置的名称。

  • "ip_allowlist.updated": optional object { id, allowed_ips }

具有此 type 的事件的详细信息。

  • id: optional string IP 允许列表配置的 ID。

  • allowed_ips: optional array of string

更新后的配置中的 IP 地址或 CIDR 范围集合。

  • "login.failed": optional object { error_code, error_message }

具有此 type 的事件的详细信息。

  • error_code: optional string

失败时的错误代码。

  • error_message: optional string

失败时的错误消息。

  • "login.succeeded": optional unknown 除标准审计日志属性外,此事件没有其他字段。

  • "logout.failed": optional object { error_code, error_message }

具有此 type 的事件的详细信息。

  • error_code: optional string

失败时的错误代码。

  • error_message: optional string

失败时的错误消息。

  • "logout.succeeded": optional unknown

除标准审计日志属性外,此事件没有其他字段。

  • "organization.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

组织 ID。

  • changes_requested: optional object { api_call_logging, api_call_logging_project_ids, description, 4 more }

更新组织设置时使用的请求数据。

  • api_call_logging: optional string 组织对受支持 API 调用的数据记录方式。可选值为 disabled、enabled_per_call、enabled_for_all_projects 或 enabled_for_selected_projects。

  • api_call_logging_project_ids: optional string

当 api_call_logging 设为 enabled_for_selected_projects 时,对应的项目 ID 列表。

  • description: optional string

组织描述。

  • name: optional string

组织名称。

  • threads_ui_visibility: optional string

线程页面的可见范围。此页面显示通过 Assistants API 和 Playground 创建的消息。可选值为 ANY_ROLE、OWNERS 或 NONE。

  • title: optional string

组织标题。

  • usage_dashboard_visibility: optional string

用量面板的可见范围。此面板显示组织的活动和费用。可选值为 ANY_ROLE 或 OWNERS。

  • project: optional object { id, name } 此操作所属的项目。不属于任何项目的操作不包含此字段。注意,通过管理员 API 密钥执行的所有管理操作都会关联到默认项目。

  • id: optional string

项目 ID。

  • name: optional string

项目标题。

  • "project.archived": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

项目 ID。

  • "project.created": optional object { id, data } 具有此 type 的事件的详细信息。

  • id: optional string

项目 ID。

  • data: optional object { name, title }

创建项目时使用的请求数据。

  • name: optional string

项目名称。

  • title: optional string

面板中显示的项目标题。

  • "project.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

项目 ID。

  • "project.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

项目 ID。

  • changes_requested: optional object { title }

更新项目时使用的请求数据。

  • title: optional string

面板中显示的项目标题。

  • "rate_limit.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string 速率限制 ID。

  • "rate_limit.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

速率限制 ID。

  • changes_requested: optional object { batch_1_day_max_input_tokens, max_audio_megabytes_per_1_minute, max_images_per_1_minute, 3 more }

更新速率限制时使用的请求数据。

  • batch_1_day_max_input_tokens: optional integer 每天最多可输入批处理任务的词元数,仅适用于某些模型。

  • max_audio_megabytes_per_1_minute: optional integer

每分钟最多可处理的音频兆字节数,仅适用于某些模型。

  • max_images_per_1_minute: optional integer

每分钟最多可处理的图像数量,仅适用于某些模型。

  • max_requests_per_1_day: optional integer

每天最多可发出的请求数,仅适用于某些模型。

  • max_requests_per_1_minute: optional integer

每分钟最多可发出的请求数。

  • max_tokens_per_1_minute: optional integer

每分钟最多可使用的词元数。

  • "role.assignment.created": optional object { id, principal_id, principal_type, 2 more }

具有此 type 的事件的详细信息。

  • id: optional string

角色分配的标识符。

  • principal_id: optional string

被授予此角色的主体(用户或群组)。

  • principal_type: optional string

被授予此角色的主体类型(用户或群组)。

  • resource_id: optional string

此角色分配适用的资源。

  • resource_type: optional string

此角色分配适用的资源类型。

  • "role.assignment.deleted": optional object { id, principal_id, principal_type, 2 more }

具有此 type 的事件的详细信息。

  • id: optional string 角色分配的标识符。

  • principal_id: optional string

被移除此角色的主体(用户或群组)。

  • principal_type: optional string

被移除此角色的主体类型(用户或群组)。

  • resource_id: optional string

此角色分配原先适用的资源。

  • resource_type: optional string

此角色分配原先适用的资源类型。

  • "role.bound_to_resource": optional object { id, connector_id, connector_name, 7 more }

具有此 type 的事件的详细信息。

  • id: optional string

此角色绑定到的资源 ID。ChatGPT 工作区连接器资源使用 <workspace_id>__<connector_id>。

  • connector_id: optional string

ChatGPT 工作区连接器资源的连接器 ID。

  • connector_name: optional string ChatGPT 工作区连接器资源的连接器显示名称;如果无法解析显示名称,则使用连接器 ID。

  • enabled: optional boolean

是否为此角色启用该连接器。

  • permissions: optional array of string

授予此角色在该资源上的权限。

  • resource_id: optional string

此角色绑定到的资源 ID。

  • resource_type: optional string 此角色绑定到的资源类型。

  • role_id: optional string

绑定到此资源的角色 ID。

  • source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more

产生此事件的连接器角色变更路径。

  • "role_toggle"

  • "role_connector_update"

  • "role_delete"

  • "workspace_permissions"

  • "connector_publish"

  • workspace_id: optional string ChatGPT 工作区连接器资源的工作区 ID。

  • "role.created": optional object { id, permissions, resource_id, 2 more }

具有此 type 的事件的详细信息。

  • id: optional string

角色 ID。

  • permissions: optional array of string

此角色授予的权限。

  • resource_id: optional string

此角色适用的资源。

  • resource_type: optional string

此角色所属的资源类型。

  • role_name: optional string

角色名称。

  • "role.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

角色 ID。

  • "role.unbound_from_resource": optional object { id, connector_id, connector_name, 7 more }

具有此 type 的事件的详细信息。

  • id: optional string

此角色解除绑定的资源 ID。ChatGPT 工作区连接器资源使用 <workspace_id>__<connector_id>。

  • connector_id: optional string

ChatGPT 工作区连接器资源的连接器 ID。

  • connector_name: optional string

ChatGPT 工作区连接器资源的连接器显示名称;如果无法解析显示名称,则使用连接器 ID。

  • enabled: optional boolean

是否为此角色启用该连接器。

  • permissions: optional array of string

变更后此角色保留的权限。

  • resource_id: optional string

此角色解除绑定的资源 ID。

  • resource_type: optional string

此角色解除绑定的资源类型。

  • role_id: optional string

从此资源解除绑定的角色 ID。

  • source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more

产生此事件的连接器角色变更路径。

  • "role_toggle"

  • "role_connector_update"
  • "role_delete"

  • "workspace_permissions"

  • "connector_publish"

  • workspace_id: optional string

ChatGPT 工作区连接器资源的工作区 ID。

  • "role.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

角色 ID。

  • changes_requested: optional object { description, metadata, permissions_added, 4 more }

更新角色时使用的请求数据。

  • description: optional string

更新后的角色描述(如果提供)。

  • metadata: optional unknown

存储在角色上的附加元数据。

  • permissions_added: optional array of string

添加到此角色的权限。

  • permissions_removed: optional array of string

从此角色移除的权限。

  • resource_id: optional string

此角色适用的资源。

  • resource_type: optional string 此角色所属的资源类型。

  • role_name: optional string

更新后的角色名称(如果提供)。

  • "scim.disabled": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

被停用 SCIM 的对象 ID。

  • "scim.enabled": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

被启用 SCIM 的对象 ID。

  • "service_account.created": optional object { id, data }

具有此 type 的事件的详细信息。

  • id: optional string

服务账号 ID。

  • data: optional object { role }

创建服务账号时使用的请求数据。

  • role: optional string

服务账号的角色,可以是 owner 或 member。

  • "service_account.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string 服务账号 ID。

  • "service_account.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

服务账号 ID。

  • changes_requested: optional object { role }

更新服务账号时使用的请求数据。

  • role: optional string

服务账号的角色,可以是 owner 或 member。

  • "user.added": optional object { id, data } 具有此 type 的事件的详细信息。

  • id: optional string

用户 ID。

  • data: optional object { role }

将用户添加到项目时使用的请求数据。

  • role: optional string

用户的角色,可以是 owner 或 member。

  • "user.deleted": optional object { id }

具有此 type 的事件的详细信息。

  • id: optional string

用户 ID。

  • "user.updated": optional object { id, changes_requested } 具有此 type 的事件的详细信息。

  • id: optional string

项目 ID。

  • changes_requested: optional object { role }

更新用户时使用的请求数据。

  • role: optional string

用户的角色,可以是 owner 或 member。

  • "workload_identity_provider_mapping.created": optional object { id, data, identity_provider_id }

具有此 type 的事件的详细信息。

  • id: optional string 工作负载身份提供商映射 ID。

  • data: optional unknown

创建工作负载身份提供商映射时使用的请求数据。

  • identity_provider_id: optional string

工作负载身份提供商 ID。

  • "workload_identity_provider_mapping.deleted": optional object { id, identity_provider_id, project_id, service_account_id }

具有此 type 的事件的详细信息。

  • id: optional string

工作负载身份提供商映射 ID。

  • identity_provider_id: optional string

工作负载身份提供商 ID。

  • project_id: optional string

项目 ID。

  • service_account_id: optional string

映射到的服务账号 ID。

  • "workload_identity_provider_mapping.updated": optional object { id, changes_requested, identity_provider_id }

具有此 type 的事件的详细信息。

  • id: optional string

工作负载身份提供商映射 ID。

  • changes_requested: optional unknown

更新工作负载身份提供商映射时使用的请求数据。

  • identity_provider_id: optional string

工作负载身份提供商 ID。

  • "workload_identity_provider.created": optional object { id, data }

具有此 type 的事件的详细信息。

  • id: optional string

工作负载身份提供商 ID。

  • data: optional unknown

创建工作负载身份提供商时使用的请求数据。

  • "workload_identity_provider.deleted": optional object { id, name }

具有此 type 的事件的详细信息。

  • id: optional string

工作负载身份提供商 ID。

  • name: optional string

工作负载身份提供商名称。

  • "workload_identity_provider.updated": optional object { id, changes_requested }

具有此 type 的事件的详细信息。

  • id: optional string

工作负载身份提供商 ID。

  • changes_requested: optional unknown

更新工作负载身份提供商时使用的请求数据。

  • has_more: boolean

  • object: "list"

  • "list"

  • first_id: optional string or null

  • last_id: optional string or null

    示例

## 使用组织管理员密钥读取审计日志;密钥从环境变量加载
curl https://api.openai.com/v1/organization/audit_logs \
    -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

200 — 示例

下方 JSON 展示字段结构;字段名和事件类型属于接口协议,按原文保留。

{
  "data": [
    {
      "id": "id",
      "effective_at": 0,
      "type": "api_key.created",
      "actor": {
        "api_key": {
          "id": "id",
          "service_account": {
            "id": "id"
          },
          "type": "user",
          "user": {
            "id": "id",
            "email": "email"
          }
        },
        "session": {
          "ip_address": "ip_address",
          "user": {
            "id": "id",
            "email": "email"
          }
        },
        "type": "session"
      },
      "api_key.created": {
        "id": "id",
        "data": {
          "scopes": [
            "string"
          ]
        }
      },
      "api_key.deleted": {
        "id": "id"
      },
      "api_key.updated": {
        "id": "id",
        "changes_requested": {
          "expires_in_seconds": 0,
          "scopes": [
            "string"
          ]
        }
      },
      "certificate.created": {
        "id": "id",
        "name": "示例名称"
      },
      "certificate.deleted": {
        "id": "id",
        "certificate": "certificate",
        "name": "示例名称"
      },
      "certificate.updated": {
        "id": "id",
        "name": "示例名称"
      },
      "certificates.activated": {
        "certificates": [
          {
            "id": "id",
            "name": "示例名称"
          }
        ]
      },
      "certificates.deactivated": {
        "certificates": [
          {
            "id": "id",
            "name": "示例名称"
          }
        ]
      },
      "checkpoint.permission.created": {
        "id": "id",
        "data": {
          "fine_tuned_model_checkpoint": "fine_tuned_model_checkpoint",
          "project_id": "project_id"
        }
      },
      "checkpoint.permission.deleted": {
        "id": "id"
      },
      "external_key.registered": {
        "id": "id",
        "data": {}
      },
      "external_key.removed": {
        "id": "id"
      },
      "external_storage.registered": {
        "id": "id",
        "data": {
          "geography": "geography",
          "provider": {
            "account_id": "account_id",
            "bucket": "bucket",
            "external_id": "external_id",
            "region": "region",
            "role_arn": "role_arn",
            "type": "aws"
          }
        }
      },
      "external_storage.removed": {
        "id": "id"
      },
      "group.created": {
        "id": "id",
        "data": {
          "group_name": "group_name"
        }
      },
      "group.deleted": {
        "id": "id"
      },
      "group.updated": {
        "id": "id",
        "changes_requested": {
          "group_name": "group_name"
        }
      },
      "invite.accepted": {
        "id": "id"
      },
      "invite.deleted": {
        "id": "id"
      },
      "invite.sent": {
        "id": "id",
        "data": {
          "email": "email",
          "role": "role"
        }
      },
      "ip_allowlist.config.activated": {
        "configs": [
          {
            "id": "id",
            "name": "示例名称"
          }
        ]
      },
      "ip_allowlist.config.deactivated": {
        "configs": [
          {
            "id": "id",
            "name": "示例名称"
          }
        ]
      },
      "ip_allowlist.created": {
        "id": "id",
        "allowed_ips": [
          "string"
        ],
        "name": "示例名称"
      },
      "ip_allowlist.deleted": {
        "id": "id",
        "allowed_ips": [
          "string"
        ],
        "name": "示例名称"
      },
      "ip_allowlist.updated": {
        "id": "id",
        "allowed_ips": [
          "string"
        ]
      },
      "login.failed": {
        "error_code": "error_code",
        "error_message": "error_message"
      },
      "login.succeeded": {},
      "logout.failed": {
        "error_code": "error_code",
        "error_message": "error_message"
      },
      "logout.succeeded": {},
      "organization.updated": {
        "id": "id",
        "changes_requested": {
          "api_call_logging": "api_call_logging",
          "api_call_logging_project_ids": "api_call_logging_project_ids",
          "description": "示例描述",
          "name": "示例名称",
          "threads_ui_visibility": "threads_ui_visibility",
          "title": "示例标题",
          "usage_dashboard_visibility": "usage_dashboard_visibility"
        }
      },
      "project": {
        "id": "id",
        "name": "示例名称"
      },
      "project.archived": {
        "id": "id"
      },
      "project.created": {
        "id": "id",
        "data": {
          "name": "示例名称",
          "title": "示例标题"
        }
      },
      "project.deleted": {
        "id": "id"
      },
      "project.updated": {
        "id": "id",
        "changes_requested": {
          "title": "示例标题"
        }
      },
      "rate_limit.deleted": {
        "id": "id"
      },
      "rate_limit.updated": {
        "id": "id",
        "changes_requested": {
          "batch_1_day_max_input_tokens": 0,
          "max_audio_megabytes_per_1_minute": 0,
          "max_images_per_1_minute": 0,
          "max_requests_per_1_day": 0,
          "max_requests_per_1_minute": 0,
          "max_tokens_per_1_minute": 0
        }
      },
      "role.assignment.created": {
        "id": "id",
        "principal_id": "principal_id",
        "principal_type": "principal_type",
        "resource_id": "resource_id",
        "resource_type": "resource_type"
      },
      "role.assignment.deleted": {
        "id": "id",
        "principal_id": "principal_id",
        "principal_type": "principal_type",
        "resource_id": "resource_id",
        "resource_type": "resource_type"
      },
      "role.bound_to_resource": {
        "id": "id",
        "connector_id": "connector_id",
        "connector_name": "connector_name",
        "enabled": true,
        "permissions": [
          "string"
        ],
        "resource_id": "resource_id",
        "resource_type": "resource_type",
        "role_id": "role_id",
        "source": "role_toggle",
        "workspace_id": "workspace_id"
      },
      "role.created": {
        "id": "id",
        "permissions": [
          "string"
        ],
        "resource_id": "resource_id",
        "resource_type": "resource_type",
        "role_name": "role_name"
      },
      "role.deleted": {
        "id": "id"
      },
      "role.unbound_from_resource": {
        "id": "id",
        "connector_id": "connector_id",
        "connector_name": "connector_name",
        "enabled": true,
        "permissions": [
          "string"
        ],
        "resource_id": "resource_id",
        "resource_type": "resource_type",
        "role_id": "role_id",
        "source": "role_toggle",
        "workspace_id": "workspace_id"
      },
      "role.updated": {
        "id": "id",
        "changes_requested": {
          "description": "示例描述",
          "metadata": {},
          "permissions_added": [
            "string"
          ],
          "permissions_removed": [
            "string"
          ],
          "resource_id": "resource_id",
          "resource_type": "resource_type",
          "role_name": "role_name"
        }
      },
      "scim.disabled": {
        "id": "id"
      },
      "scim.enabled": {
        "id": "id"
      },
      "service_account.created": {
        "id": "id",
        "data": {
          "role": "role"
        }
      },
      "service_account.deleted": {
        "id": "id"
      },
      "service_account.updated": {
        "id": "id",
        "changes_requested": {
          "role": "role"
        }
      },
      "user.added": {
        "id": "id",
        "data": {
          "role": "role"
        }
      },
      "user.deleted": {
        "id": "id"
      },
      "user.updated": {
        "id": "id",
        "changes_requested": {
          "role": "role"
        }
      },
      "workload_identity_provider_mapping.created": {
        "id": "id",
        "data": {},
        "identity_provider_id": "identity_provider_id"
      },
      "workload_identity_provider_mapping.deleted": {
        "id": "id",
        "identity_provider_id": "identity_provider_id",
        "project_id": "project_id",
        "service_account_id": "service_account_id"
      },
      "workload_identity_provider_mapping.updated": {
        "id": "id",
        "changes_requested": {},
        "identity_provider_id": "identity_provider_id"
      },
      "workload_identity_provider.created": {
        "id": "id",
        "data": {}
      },
      "workload_identity_provider.deleted": {
        "id": "id",
        "name": "示例名称"
      },
      "workload_identity_provider.updated": {
        "id": "id",
        "changes_requested": {}
      }
    }
  ],
  "has_more": true,
  "object": "list",
  "first_id": "audit_log-defb456h8dks",
  "last_id": "audit_log-hnbkd8s93s"
}

示例

## 使用组织管理员密钥读取审计日志;密钥从环境变量加载
curl https://api.openai.com/v1/organization/audit_logs \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"

响应示例

下方两个日志分别演示项目归档和 API 密钥更新;actor 描述执行者,effective_at 是事件时间。

{
    "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",
                    "ja3": "a497151ce4338a12c4418c44d375173e",
                    "ja4": "q13d0313h3_55b375c5d22e_c7319ce65786",
                    "ip_address_details": {
                      "country": "US",
                      "city": "San Francisco",
                      "region": "California",
                      "region_code": "CA",
                      "asn": "1234",
                      "latitude": "37.77490",
                      "longitude": "-122.41940"
                    }
                }
            },
            "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
}
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号