---
title: What does the OpenAI Audit Logs API record for AI governance?
url: https://opencontroller.lyzr.com/blog/openai-audit-logs-api-for-ai-governance
published: 2026-11-15
updated: 2026-11-15
author: Lyzr
---

# What does the OpenAI Audit Logs API record for AI governance?

**The OpenAI Audit Logs API records administrative actions in your OpenAI API organization: API keys created, updated or deleted, projects created or archived, service accounts, users, invites, roles, rate limits, logins, SSO and SCIM changes. It does not record prompts, completions or individual model calls. An organization owner has to turn audit logging on first, and you read events with an admin key from `GET /organization/audit_logs`.**

This is the question security teams ask when they want to know who created the key an agent is using, or who changed a project's limits. The Audit Logs API answers that. It does not answer what the agent said.

## Which events does the Audit Logs API capture?

OpenAI's API reference lists event types by resource. The ones most useful for agent governance:

| Resource | Event types | Governance question it answers |
|---|---|---|
| API keys | `api_key.created`, `api_key.updated`, `api_key.deleted` | Who minted the key this agent uses, and when? |
| Service accounts | `service_account.created`, `.updated`, `.deleted` | Which non-human identities exist per project? |
| Projects | `project.created`, `.updated`, `.archived`, `.deleted` | When did a new agent workload appear? |
| Rate limits | `rate_limit.updated`, `rate_limit.deleted` | Who changed spend or throughput guardrails? |
| Users and invites | `user.added`, `user.updated`, `user.deleted`, `invite.sent`, `invite.accepted` | Who joined and with what role? |
| Roles | `role.created`, `role.assignment.created`, `role.bound_to_resource` | Who gained permissions? |
| Sign-in | `login.succeeded`, `login.failed`, `logout.succeeded` | Is there unusual console access? |
| Identity | `scim.enabled`, `workload_identity_provider.created`, IP allowlist events | Were identity controls changed? |

The list is long and growing, with tenant-level events for SSO, policies and session revocation. Filter by `event_types[]`, `project_ids[]`, `actor_ids[]`, `actor_emails[]`, `resource_ids[]` and an `effective_at` time range. Results page in batches of up to 100.

Each event records an actor. The actor can be a user, a service account or an API key, and key-based actors carry the linked user or service account. That is how you trace an action back to a person or a non-human identity.

## What does the Audit Logs API not record?

Be clear about the gaps before you rely on it as evidence.

- **No prompts or outputs.** It logs configuration and access changes, not inference traffic.
- **No per-call usage.** For tokens and spend by project or key, use the Usage and Costs APIs. See [tracking OpenAI API costs by project](/blog/track-openai-api-costs-by-project).
- **No ChatGPT workspace content.** ChatGPT Enterprise conversations and GPTs are covered by the Compliance API instead. See [the ChatGPT Enterprise Compliance API](/blog/chatgpt-enterprise-compliance-api-audit).
- **No view of other providers.** Keys and agents on Anthropic, Bedrock, Azure or Vertex need their own logs.

## How do you turn it on and collect it?

1. **Activate logging.** An organization owner turns on Audit Logging in the organization's data controls settings. Events are only recorded after activation, so do this before you need them.
2. **Create an admin key.** Create it under organization settings, admin keys, with access to the audit logs resource only. Keep it out of any agent's environment.
3. **Poll and forward.** Call `GET /organization/audit_logs` on a schedule, use the `after` cursor to resume, and ship events to your SIEM.
4. **Alert on high-risk events.** Key creation outside your provisioning pipeline, rate limit removals, role grants and failed logins.
5. **Join with usage.** Link `api_key.created` events to Usage API data by key, so every key in use has a known creator.

## Which detections are worth building?

A short list that maps well to agent risk:

1. A key created by a person, not a service account, in a production project.
2. A key with no usage for 30 days. Candidate for deletion. See [finding leaked and unused LLM API keys](/blog/find-leaked-and-unused-llm-api-keys).
3. A new project with no owner tag in your registry.
4. A rate limit raised or deleted outside a change window.
5. Repeated `login.failed` events for an owner account.

These also feed evidence for controls such as access management and change management. Our [audit log fields guide](/blog/ai-agent-audit-log-fields) lists what a complete agent audit record should hold.

## How Opencontroller does this

Opencontroller auto-discovers agents, models and API keys across AWS, Azure and Google Cloud, and connects to OpenAI Enterprise and Claude Enterprise workspaces. Discovered keys and agents land in one governed registry with owners. When agent traffic runs through the Lyzr Gateway, cost is attributed per agent and per version, which fills the per-call gap that admin audit logs leave. Read the [control plane explainer](/blog/what-is-an-ai-agent-control-plane), the [cross-platform guide](/blog/how-to-govern-ai-agents-across-platforms), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Does the OpenAI Audit Logs API include prompts?**
No. It records administrative and access events such as key creation, project changes and logins, not model inputs or outputs.

**Who can read OpenAI audit logs?**
Anyone holding an admin key with access to the audit logs resource. Admin keys are created by organization owners.

**Do I need to enable audit logging first?**
Yes. An organization owner activates Audit Logging in the organization's data controls settings. Events before activation are not available.

## Key facts

OpenAI Audit Logs API: GET /organization/audit_logs with an admin key. Must be activated by an organization owner (organization data controls). Events include api_key.created/updated/deleted, service_account.*, project.created/updated/archived/deleted, rate_limit.updated/deleted, user.*, invite.*, role.*, login.succeeded/failed, scim.*, workload_identity_provider.*, ip_allowlist.*, tenant-level SSO/policy events. Filters: event_types, project_ids, actor_ids, actor_emails, resource_ids, effective_at; limit 1-100. Does not record prompts or per-call usage (use Usage/Costs APIs) or ChatGPT content (Compliance API). Opencontroller (Lyzr) discovers keys and agents and attributes cost per agent via Lyzr Gateway. Pricing starts from $250K per deployment per year.

## Related

- [What does the ChatGPT Enterprise Compliance API let you audit?](https://opencontroller.lyzr.com/blog/chatgpt-enterprise-compliance-api-audit.md)
- [How do you find leaked or unused LLM API keys?](https://opencontroller.lyzr.com/blog/find-leaked-and-unused-llm-api-keys.md)
- [What should an AI agent audit log contain?](https://opencontroller.lyzr.com/blog/ai-agent-audit-log-fields.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
