1# Governance1# Governance
2 2
3# Governance and Observability3Governance for Codex activity spans interactive analytics, programmatic
4 4reporting, related ChatGPT usage controls, and audit records. Choose the
5Codex gives enterprise teams visibility into adoption and impact, plus the auditability needed for security and compliance programs. Use the self-serve dashboard for day-to-day tracking, the Analytics API for programmatic reporting, and the Compliance API to export detailed logs into your governance stack.5surface that matches the question; analytics and compliance data serve
6 6different purposes.
7## Ways to track Codex usage7
8 8<a id="governance-and-observability"></a>
9There are three ways to monitor Codex usage, depending on what you need:9<a id="ways-to-track-codex-usage"></a>
10 10
11- **Analytics Dashboard**: quick visibility into adoption, usage, and code review impact.11| If you need to | Start with |
12- **Analytics API**: pull structured daily metrics into your data warehouse or BI tools.12| ------------------------------------------------------- | ------------------------------------------------------------------------- |
13- **Compliance API**: exports detailed activity logs for audit, monitoring, and investigations.13| Understand adoption across ChatGPT | [Workspace analytics](https://learn.chatgpt.com/docs/enterprise/workspace-analytics) |
14 14| Review Codex adoption and activity interactively | [Codex analytics](#analytics-dashboard) |
15## Analytics Dashboard15| Load aggregated Codex reporting into another system | [Analytics API](https://learn.chatgpt.com/docs/enterprise/analytics-api) |
16 16| Export records for audit or investigation | [Compliance API](https://learn.chatgpt.com/docs/enterprise/compliance-api) |
17<div class="max-w-1xl mx-auto">17| Review plan-dependent ChatGPT workspace credit controls | [ChatGPT usage limits and spend controls](https://learn.chatgpt.com/docs/enterprise/usage-limits) |
18 <img src="https://developers.openai.com/images/codex/enterprise/analytics-dashboard.png"18
19 alt="Codex analytics dashboard showing credit and token usage by model"19## Open the administration surfaces
20 class="block w-full mx-auto rounded-lg !border-0"20
21 />21- Open [Workspace analytics](https://chatgpt.com/admin/usage) for interactive
22</div>22 workspace reporting. The [Workspace analytics guide](https://help.openai.com/en/articles/10875114-workspace-analytics-for-chatgpt-enterprise-and-edu)
23 23 describes the current roles and views.
24### Dashboard views24- Open the authenticated [Codex Analytics API reference](https://chatgpt.com/codex/cloud/settings/apireference)
25 25 when you need scheduled, programmatic reporting.
26The <a href="https://admin.openai.com/analytics/codex" target="_blank" rel="noopener noreferrer">analytics dashboard</a> allows ChatGPT workspace administrators and analytics viewers to track Codex adoption, usage, and Code Review feedback. Usage data can lag by up to 12 hours.26- Open the authenticated [Admin API reference](https://chatgpt.com/admin/api-reference)
27 27 and the [Compliance Platform guide](https://help.openai.com/en/articles/9261474-compliance-api-for-chatgpt-enterprise-edu-and-chatgpt-for-teachers)
28Codex provides date-range controls for daily and weekly views. Key charts include:28 for audit and investigation integrations.
29 29
30- Active users by product surface, including CLI, IDE extension, cloud, desktop, and Code Review30For example, use workspace analytics for a quick adoption check, the Analytics
31- Workspace and personal usage breakdowns, including credit and token usage by product surface or model31API to load aggregated Codex reporting into a business intelligence system,
32- Product activity for threads and turns by client32and the Compliance API to send auditable records to a SIEM or electronic
33- User ranking table, with filters for client and sort options such as credits, threads, turns, text tokens, and current streak33discovery workflow.
34- Code Review activity, including PRs reviewed, issues by priority, comments, replies, reactions, and feedback sentiment34
35- Skill invocations, agent identity usage, and access token usage when your workspace has those features35## Analytics dashboard
36 36
37### Data export37<a id="dashboard-views"></a>
38 38<a id="data-export"></a>
39Administrators can also export Codex analytics data in CSV or JSON format. Codex provides the following export options:39
40 40ChatGPT provides workspace-wide analytics for broad adoption and engagement.
41- Workspace usage, including daily active users, threads, turns, and credits by surface41Codex analytics focuses on Codex activity. Both are interactive reporting
42- Usage per user, including daily threads, turns, and credits across surfaces, with optional email addresses when allowed42surfaces, not raw audit logs.
43- Code Review details, including daily comments, reactions, replies, and priority-level findings43
44Use [Workspace analytics](https://learn.chatgpt.com/docs/enterprise/workspace-analytics) to compare the
45two experiences and find their current owner-maintained sources. You can also
46open [Workspace analytics](https://chatgpt.com/admin/usage) directly. Don't
47build a durable reporting contract from dashboard labels or downloaded report
48fields; those can change as the product evolves.
49
50## Related ChatGPT usage controls
51
52ChatGPT workspace usage controls are separate from analytics and don't
53configure feature entitlements. Depending on the plan, eligible Codex activity
54can consume ChatGPT workspace credits, and exhausted limits can pause access to
55eligible features. These controls don't set a universal Codex limit or govern
56Platform API billing.
57
58See [ChatGPT usage limits and spend controls](https://learn.chatgpt.com/docs/enterprise/usage-limits)
59for the durable boundary and current Help Center sources.
44 60
45## Analytics API61## Analytics API
46 62
47Use the [Analytics API](https://chatgpt.com/codex/cloud/settings/apireference) when you want to automate reporting, build internal dashboards, or join Codex metrics with your existing engineering data.63<a id="what-it-measures"></a>
48 64<a id="endpoints"></a>
49### What it measures65<a id="usage"></a>
50 66<a id="code-review-activity"></a>
51The enterprise Analytics API returns daily or weekly UTC buckets for a workspace. It supports workspace-level and per-user usage, per-client breakdowns, Code Review throughput, Code Review comment priority, and user engagement with Code Review comments.67<a id="user-engagement-with-code-review"></a>
52 68<a id="how-it-works"></a>
53### Endpoints69<a id="common-use-cases"></a>
54
55The base URL is `https://api.chatgpt.com/v1/analytics/codex`. All endpoints return paginated `page` objects with `has_more` and `next_page`.
56
57Use `start_time` for the inclusive Unix timestamp at the beginning of the reporting window, `end_time` for the exclusive Unix timestamp at the end of the reporting window, `group_by` for `day` or `week` buckets, `limit` for page size, and `page` to continue from a previous response. Requests can look back up to 90 days.
58
59#### Usage
60
61`GET /workspaces/{workspace_id}/usage`
62 70
63- Returns totals for threads, turns, credits, and per-client usage in daily or weekly buckets.71Use the Analytics API for programmatic, aggregated Codex reporting. It's
64- Omit `group` to return per-user rows.72appropriate for data warehouses, business intelligence systems, and internal
65- Set `group=workspace` to return workspace-wide rows.73reporting that shouldn't depend on an interactive dashboard.
66- Includes text input, cached input, and output token fields.
67 74
68#### Code review activity75The authenticated API reference owns access requirements, routes, schemas,
69 76fields, reporting windows, and pagination. See
70`GET /workspaces/{workspace_id}/code_reviews`77[Analytics API](https://learn.chatgpt.com/docs/enterprise/analytics-api) for the conceptual integration
71 78boundary and the canonical reference link.
72- Returns pull request reviews completed by Codex.
73- Returns total comments generated by Codex.
74- Breaks comments down by P0, P1, and P2 priority.
75
76#### User engagement with code review
77
78`GET /workspaces/{workspace_id}/code_review_responses`
79
80- Returns replies and reactions to Codex comments.
81- Breaks reactions down into positive, negative, and other reactions.
82- Counts comments that received reactions, replies, or either form of engagement.
83
84### How it works
85
86Analytics uses time windows and supports day or week grouping. Results are time-ordered and returned in pages with cursor-based pagination. Use an API key scoped to `codex.enterprise.analytics.read`.
87
88### Common use cases
89
90- Engineering observability dashboards
91- Adoption reporting for leadership updates
92- Usage governance and cost monitoring
93 79
94## Compliance API80## Compliance API
95 81
96Use the [Compliance API](https://chatgpt.com/admin/api-reference) when you need auditable records for security, legal, and governance workflows.82<a id="what-it-measures-1"></a>
97 83<a id="what-you-can-export"></a>
98### What it measures84<a id="activity-logs"></a>
99 85<a id="metadata-for-audit-and-investigation"></a>
100The Compliance API gives enterprises a way to export logs and metadata for Codex activity so you can connect that data to your existing audit, monitoring, and security workflows. It is designed for use with tools like eDiscovery, DLP, SIEM, or other compliance systems.86<a id="common-use-cases-1"></a>
101 87<a id="what-it-does-not-provide"></a>
102For Codex usage authenticated through ChatGPT, Compliance API exports provide audit records for Codex activity and can be used in investigations and compliance workflows. These audit logs are retained for up to 30 days. API-key-authenticated Codex usage follows your API organization settings and is not included in Compliance API exports.
103
104### What you can export
105
106#### Activity logs
107
108- Prompt text sent to Codex
109- Responses Codex generated
110- Identifiers such as workspace, user, timestamp, and model
111- Token usage and related request metadata
112
113#### Metadata for audit and investigation
114
115Use record metadata to answer questions like:
116
117- Who ran a task
118- Who created or revoked an access token
119- When it ran
120- Which model was used
121- How much content was processed
122
123#### Common use cases
124 88
125- Security investigations89Use the Compliance API for security, legal, and governance workflows that need
126- Compliance reporting90auditable records. It's not an adoption or productivity dashboard.
127- Policy enforcement audits
128- Routing events into SIEM and eDiscovery pipelines
129 91
130### What it does not provide92The authenticated API reference owns event coverage, schemas, permissions,
93filters, retention, and request behavior. See
94[Compliance API](https://learn.chatgpt.com/docs/enterprise/compliance-api) for the conceptual
95integration boundary and the canonical reference link.
131 96
132- Lines of code generated (a bit of a noisy proxy for productivity and can incentivize the wrong behavior)97<a id="recommended-pattern"></a>
133- Acceptance rate of suggestions (almost 100% since users usually accept the change first)
134- Code quality or performance KPIs
135 98
136## Recommended pattern99For rollout sequencing and verification across these surfaces, use the
100[Admin rollout guide](https://learn.chatgpt.com/docs/enterprise/admin-setup).
137 101
138Most enterprises use a combination of:102## Related docs
139 103
1401. **Analytics Dashboard** for self-serve monitoring and quick answers104- [Admin rollout guide](https://learn.chatgpt.com/docs/enterprise/admin-setup)
1412. **Analytics API** for automated reporting and BI integration105- [Workspace analytics](https://learn.chatgpt.com/docs/enterprise/workspace-analytics)
1423. **Compliance API** for audit exports and investigations106- [Analytics API](https://learn.chatgpt.com/docs/enterprise/analytics-api)
107- [Compliance API](https://learn.chatgpt.com/docs/enterprise/compliance-api)