Codex
Antenna automatically tracks AI coding metrics from OpenAI Codex by pulling data from the Codex Enterprise Analytics API. Get insight into adoption, activity, and the impact of Codex on your team’s productivity.
The Codex Analytics API is currently available only for ChatGPT Enterprise customers. ChatGPT Plus users are not supported.
Prerequisites
- A ChatGPT Enterprise subscription with Codex enabled
- Workspace owner or workspace admin access to the OpenAI Admin console
- Your workspace ID from the ChatGPT Admin console
Which API key you need
OpenAI issues several kinds of credentials, and only one of them can read Codex analytics: a workspace-scoped Admin key with the Codex analytics API permission set to Read (the codex.enterprise.analytics.read scope). Admin keys are created in the OpenAI Admin console, not in the API Platform portal.
| Credential | Where it comes from | Works for this integration |
|---|---|---|
| Admin key with Codex analytics API: Read | OpenAI Admin console > Credentials > Admin keys | Yes |
| API Platform project or organization key | platform.openai.com | No |
| Codex access token or service-account token | ChatGPT Admin console | No — these authenticate Codex CLI and automation, not the Analytics API |
Setup
Create an Admin key
- Sign in to the OpenAI Admin console as a workspace owner or workspace admin, and go to Credentials > Admin keys.
- Select Create new admin key and give it a descriptive name such as
Antenna Codex Analytics. - Select the workspace you want Antenna to report on.
- Choose Custom permissions and set Codex analytics API to Read. This grants the
codex.enterprise.analytics.readscope. - Copy the key and store it securely — you can only view it once.
The key must be an Admin key with the Codex analytics API permission. API Platform project keys cannot read Codex analytics, even with read-only permissions.
Find your workspace ID
Open the ChatGPT Admin console as a ChatGPT admin or Codex admin and copy the Workspace ID from the workspace settings page. Use the workspace your Admin key is scoped to.
Connect in Antenna
- In Antenna, go to Settings > Sources > Add source.
- Find Codex and click Connect.
- Paste your Admin key and workspace ID.
- Click Connect.
Data collected
We pull from the Codex Enterprise Analytics API:
| Purpose | Endpoint |
|---|---|
| Daily usage metrics | GET /v1/analytics/codex/workspaces/{workspace_id}/usage |
This API returns daily Codex adoption and code review metrics for a workspace, including:
- Threads and turns — total conversation threads and individual turns
- Credits — credit consumption per user or workspace
- Per-client usage — breakdowns by client application
- Token usage — text input, cached input, and output token counts
Requests use Authorization: Bearer <admin_api_key> against https://api.chatgpt.com/v1/analytics/codex.
OpenAI documentation
| Topic | OpenAI documentation |
|---|---|
| Endpoints, schemas, scopes, and key provisioning | Codex Analytics API reference (sign-in required) |
| What the Analytics API is for and its workspace boundary | Analytics API |
| Which reporting surface owns which data | Workspace analytics and Governance |
| Who can administer workspace credentials | Roles and workspace permissions |
| Audit and investigation records, which the Analytics API does not provide | Compliance API |