Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
find_apisBrowse and filter every API in the catalog.
get_api_artifactsOne API's artifacts, grouped by type.
get_openapiThe primary OpenAPI for this API.
find_similar_apisAPIs that look like this one.
apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
resolveTurn a domain, URL or GitHub org into the provider it belongs to.
find_cohortsEvery scored population of providers in the catalog.
All 92 tools →
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/openai-audit-logs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: OpenAI Audit Logs API
description: The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
version: 2.3.0
termsOfService: https://openai.com/policies/terms-of-use
contact:
name: OpenAI Support
url: https://help.openai.com/
license:
name: MIT
url: https://github.com/openai/openai-openapi/blob/master/LICENSE
servers:
- url: https://api.openai.com/v1
security:
- ApiKeyAuth: []
tags:
- name: Audit Logs
description: List user actions and configuration changes within this organization.
paths:
/organization/audit_logs:
get:
security:
- AdminApiKeyAuth: []
summary: List user actions and configuration changes within this organization.
operationId: list-audit-logs
tags:
- Audit Logs
parameters:
- name: effective_at
in: query
description: Return only events whose `effective_at` (Unix seconds) is in this range.
required: false
schema:
type: object
properties:
gt:
type: integer
description: Return only events whose `effective_at` (Unix seconds) is greater than this value.
gte:
type: integer
description: Return only events whose `effective_at` (Unix seconds) is greater than or equal to this value.
lt:
type: integer
description: Return only events whose `effective_at` (Unix seconds) is less than this value.
lte:
type: integer
description: Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.
- name: project_ids[]
in: query
description: Return only events for these projects.
required: false
schema:
type: array
items:
type: string
- name: event_types[]
in: query
description: Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](/docs/api-reference/audit-logs/object).
required: false
schema:
type: array
items:
$ref: '#/components/schemas/AuditLogEventType'
- name: actor_ids[]
in: query
description: Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.
required: false
schema:
type: array
items:
type: string
- name: actor_emails[]
in: query
description: Return only events performed by users with these emails.
required: false
schema:
type: array
items:
type: string
- name: resource_ids[]
in: query
description: Return only events performed on these targets. For example, a project ID updated.
required: false
schema:
type: array
items:
type: string
- name: limit
in: query
description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
'
required: false
schema:
type: integer
default: 20
- name: after
in: query
description: 'A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
'
schema:
type: string
- name: before
in: query
description: 'A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
'
schema:
type: string
responses:
'200':
description: Audit logs listed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/ListAuditLogsResponse'
x-oaiMeta:
name: List audit logs
group: audit-logs
examples:
request:
curl: 'curl https://api.openai.com/v1/organization/audit_logs \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"
'
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const auditLogListResponse of client.admin.organization.auditLogs.list()) {\n console.log(auditLogListResponse.id);\n}"
python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n admin_api_key=os.environ.get(\"OPENAI_ADMIN_KEY\"), # This is the default and can be omitted\n)\npage = client.admin.organization.audit_logs.list()\npage = page.data[0]\nprint(page.id)"
go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAdminAPIKey(\"My Admin API Key\"),\n\t)\n\tpage, err := client.Admin.Organization.AuditLogs.List(context.TODO(), openai.AdminOrganizationAuditLogListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.admin.organization.auditlogs.AuditLogListPage;\nimport com.openai.models.admin.organization.auditlogs.AuditLogListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AuditLogListPage page = client.admin().organization().auditLogs().list();\n }\n}"
ruby: 'require "openai"
openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")
page = openai.admin.organization.audit_logs.list
puts(page)'
response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"audit_log-xxx_yyyymmdd\",\n \"type\": \"project.archived\",\n \"effective_at\": 1722461446,\n \"actor\": {\n \"type\": \"api_key\",\n \"api_key\": {\n \"type\": \"user\",\n \"user\": {\n \"id\": \"user-xxx\",\n \"email\": \"user@example.com\"\n }\n }\n },\n \"project.archived\": {\n \"id\": \"proj_abc\"\n },\n },\n {\n \"id\": \"audit_log-yyy__20240101\",\n \"type\": \"api_key.updated\",\n \"effective_at\": 1720804190,\n \"actor\": {\n \"type\": \"session\",\n \"session\": {\n \"user\": {\n \"id\": \"user-xxx\",\n \"email\": \"user@example.com\"\n },\n \"ip_address\": \"127.0.0.1\",\n \"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\",\n \"ja3\": \"a497151ce4338a12c4418c44d375173e\",\n \"ja4\": \"q13d0313h3_55b375c5d22e_c7319ce65786\",\n \"ip_address_details\": {\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"region\": \"California\",\n \"region_code\": \"CA\",\n \"asn\": \"1234\",\n \"latitude\": \"37.77490\",\n \"longitude\": \"-122.41940\"\n }\n }\n },\n \"api_key.updated\": {\n \"id\": \"key_xxxx\",\n \"data\": {\n \"scopes\": [\"resource_2.operation_2\"]\n }\n },\n }\n ],\n \"first_id\": \"audit_log-xxx__20240101\",\n \"last_id\": \"audit_log_yyy__20240101\",\n \"has_more\": true\n}\n"
components:
schemas:
AuditLogActorUser:
type: object
description: The user who performed the audit logged action.
properties:
id:
type: string
description: The user id.
email:
type: string
description: The user email.
AuditLog:
type: object
description: A log of a user action or configuration change within this organization.
properties:
id:
type: string
description: The ID of this log.
type:
$ref: '#/components/schemas/AuditLogEventType'
effective_at:
type: integer
format: unixtime
description: The Unix timestamp (in seconds) of the event.
project:
type: object
description: The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project.
properties:
id:
type: string
description: The project ID.
name:
type: string
description: The project title.
actor:
anyOf:
- $ref: '#/components/schemas/AuditLogActor'
- type: 'null'
api_key.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The tracking ID of the API key.
data:
type: object
description: The payload used to create the API key.
properties:
scopes:
type: array
items:
type: string
description: A list of scopes allowed for the API key, e.g. `["api.model.request"]`
api_key.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The tracking ID of the API key.
changes_requested:
type: object
description: The payload used to update the API key.
properties:
scopes:
type: array
items:
type: string
description: A list of scopes allowed for the API key, e.g. `["api.model.request"]`
api_key.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The tracking ID of the API key.
checkpoint.permission.created:
type: object
description: The project and fine-tuned model checkpoint that the checkpoint permission was created for.
properties:
id:
type: string
description: The ID of the checkpoint permission.
data:
type: object
description: The payload used to create the checkpoint permission.
properties:
project_id:
type: string
description: The ID of the project that the checkpoint permission was created for.
fine_tuned_model_checkpoint:
type: string
description: The ID of the fine-tuned model checkpoint.
checkpoint.permission.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the checkpoint permission.
external_key.registered:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the external key configuration.
data:
type: object
description: The configuration for the external key.
external_key.removed:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the external key configuration.
group.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the group.
data:
type: object
description: Information about the created group.
properties:
group_name:
type: string
description: The group name.
group.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the group.
changes_requested:
type: object
description: The payload used to update the group.
properties:
group_name:
type: string
description: The updated group name.
group.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the group.
scim.enabled:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the SCIM was enabled for.
scim.disabled:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the SCIM was disabled for.
invite.sent:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the invite.
data:
type: object
description: The payload used to create the invite.
properties:
email:
type: string
description: The email invited to the organization.
role:
type: string
description: The role the email was invited to be. Is either `owner` or `member`.
invite.accepted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the invite.
invite.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the invite.
ip_allowlist.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the IP allowlist configuration.
name:
type: string
description: The name of the IP allowlist configuration.
allowed_ips:
type: array
description: The IP addresses or CIDR ranges included in the configuration.
items:
type: string
ip_allowlist.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the IP allowlist configuration.
allowed_ips:
type: array
description: The updated set of IP addresses or CIDR ranges in the configuration.
items:
type: string
ip_allowlist.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The ID of the IP allowlist configuration.
name:
type: string
description: The name of the IP allowlist configuration.
allowed_ips:
type: array
description: The IP addresses or CIDR ranges that were in the configuration.
items:
type: string
ip_allowlist.config.activated:
type: object
description: The details for events with this `type`.
properties:
configs:
type: array
description: The configurations that were activated.
items:
type: object
properties:
id:
type: string
description: The ID of the IP allowlist configuration.
name:
type: string
description: The name of the IP allowlist configuration.
ip_allowlist.config.deactivated:
type: object
description: The details for events with this `type`.
properties:
configs:
type: array
description: The configurations that were deactivated.
items:
type: object
properties:
id:
type: string
description: The ID of the IP allowlist configuration.
name:
type: string
description: The name of the IP allowlist configuration.
login.succeeded:
type: object
description: This event has no additional fields beyond the standard audit log attributes.
login.failed:
type: object
description: The details for events with this `type`.
properties:
error_code:
type: string
description: The error code of the failure.
error_message:
type: string
description: The error message of the failure.
logout.succeeded:
type: object
description: This event has no additional fields beyond the standard audit log attributes.
logout.failed:
type: object
description: The details for events with this `type`.
properties:
error_code:
type: string
description: The error code of the failure.
error_message:
type: string
description: The error message of the failure.
organization.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The organization ID.
changes_requested:
type: object
description: The payload used to update the organization settings.
properties:
title:
type: string
description: The organization title.
description:
type: string
description: The organization description.
name:
type: string
description: The organization name.
threads_ui_visibility:
type: string
description: Visibility of the threads page which shows messages created with the Assistants API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`.
usage_dashboard_visibility:
type: string
description: Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`.
api_call_logging:
type: string
description: How your organization logs data from supported API calls. One of `disabled`, `enabled_per_call`, `enabled_for_all_projects`, or `enabled_for_selected_projects`
api_call_logging_project_ids:
type: string
description: The list of project ids if api_call_logging is set to `enabled_for_selected_projects`
project.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The project ID.
data:
type: object
description: The payload used to create the project.
properties:
name:
type: string
description: The project name.
title:
type: string
description: The title of the project as seen on the dashboard.
project.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The project ID.
changes_requested:
type: object
description: The payload used to update the project.
properties:
title:
type: string
description: The title of the project as seen on the dashboard.
project.archived:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The project ID.
project.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The project ID.
rate_limit.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The rate limit ID
changes_requested:
type: object
description: The payload used to update the rate limits.
properties:
max_requests_per_1_minute:
type: integer
description: The maximum requests per minute.
max_tokens_per_1_minute:
type: integer
description: The maximum tokens per minute.
max_images_per_1_minute:
type: integer
description: The maximum images per minute. Only relevant for certain models.
max_audio_megabytes_per_1_minute:
type: integer
description: The maximum audio megabytes per minute. Only relevant for certain models.
max_requests_per_1_day:
type: integer
description: The maximum requests per day. Only relevant for certain models.
batch_1_day_max_input_tokens:
type: integer
description: The maximum batch input tokens per day. Only relevant for certain models.
rate_limit.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The rate limit ID
role.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The role ID.
role_name:
type: string
description: The name of the role.
permissions:
type: array
items:
type: string
description: The permissions granted by the role.
resource_type:
type: string
description: The type of resource the role belongs to.
resource_id:
type: string
description: The resource the role is scoped to.
role.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The role ID.
changes_requested:
type: object
description: The payload used to update the role.
properties:
role_name:
type: string
description: The updated role name, when provided.
resource_id:
type: string
description: The resource the role is scoped to.
resource_type:
type: string
description: The type of resource the role belongs to.
permissions_added:
type: array
items:
type: string
description: The permissions added to the role.
permissions_removed:
type: array
items:
type: string
description: The permissions removed from the role.
description:
type: string
description: The updated role description, when provided.
metadata:
type: object
description: Additional metadata stored on the role.
role.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The role ID.
role.assignment.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The identifier of the role assignment.
principal_id:
type: string
description: The principal (user or group) that received the role.
principal_type:
type: string
description: The type of principal (user or group) that received the role.
resource_id:
type: string
description: The resource the role assignment is scoped to.
resource_type:
type: string
description: The type of resource the role assignment is scoped to.
role.assignment.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The identifier of the role assignment.
principal_id:
type: string
description: The principal (user or group) that had the role removed.
principal_type:
type: string
description: The type of principal (user or group) that had the role removed.
resource_id:
type: string
description: The resource the role assignment was scoped to.
resource_type:
type: string
description: The type of resource the role assignment was scoped to.
service_account.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The service account ID.
data:
type: object
description: The payload used to create the service account.
properties:
role:
type: string
description: The role of the service account. Is either `owner` or `member`.
service_account.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The service account ID.
changes_requested:
type: object
description: The payload used to updated the service account.
properties:
role:
type: string
description: The role of the service account. Is either `owner` or `member`.
service_account.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The service account ID.
user.added:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The user ID.
data:
type: object
description: The payload used to add the user to the project.
properties:
role:
type: string
description: The role of the user. Is either `owner` or `member`.
user.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The project ID.
changes_requested:
type: object
description: The payload used to update the user.
properties:
role:
type: string
description: The role of the user. Is either `owner` or `member`.
user.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The user ID.
certificate.created:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The certificate ID.
name:
type: string
description: The name of the certificate.
certificate.updated:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The certificate ID.
name:
type: string
description: The name of the certificate.
certificate.deleted:
type: object
description: The details for events with this `type`.
properties:
id:
type: string
description: The certificate ID.
name:
type: string
description: The name of the certificate.
certificate:
type: string
description: The certificate content in PEM format.
certificates.activated:
type: object
description: The details for events with this `type`.
properties:
certificates:
type: array
items:
type: object
properties:
id:
type: string
description: The certificate ID.
name:
type: string
description: The name of the certificate.
certificates.deactivated:
type: object
description: The details for events with this `type`.
properties:
certificates:
type: array
items:
type: object
properties:
id:
type: string
description: The cer
# --- truncated at 32 KB (57 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/openai/refs/heads/main/openapi/openai-audit-logs-api-openapi.yml