Codex integration
Enabling Codex metrics
Read more about Swarmia's other AI coding tool integrations and understanding the impact of AI tools.
Swarmia reads Codex usage from the Codex Enterprise Analytics API, which is available on ChatGPT Enterprise. Codex Business isn't supported yet.
Enabling Codex metrics
You need two things from ChatGPT: your workspace ID and an admin key that can read the workspace's Codex analytics.
1. Find your workspace ID
Open the ChatGPT admin console and find the Workspace ID from the workspace settings page. You need the ChatGPT admin or Codex admin role.
2. Create an admin key
In the OpenAI admin console, go to Credentials → Admin keys and click Create new admin key:
Choose the workspace you copied the ID from.
Under permissions, select Restricted and add two read scopes:
codex.enterprise.analytics.readchatgpt.enterprise.usage_limit.read
The key is shown only once, so copy it before closing the dialog.
3. Connect Codex in Swarmia
Paste the workspace ID and the admin key into Settings → AI tools → Codex and click Apply. You need the organization admin role. We fetch 180 days of historical activity data upon connection.
Where Codex data shows up
Once connected, Codex appears alongside your other AI tools in:
AI adoption, as weekly active users per person and team.
AI tool detection & filters, which tags the pull requests Codex worked on.
AI impact: Code, where you can compare Codex-assisted pull requests against the rest.
AI cost, as AI token usage from Codex per person, team, and work item.
Codex doesn't have a dedicated activity breakdown page yet.
Frequently asked questions
Why isn't Codex Business supported?
The Codex Enterprise Analytics API is only available on ChatGPT Enterprise. We're working on a way to measure Codex usage on Business workspaces. Email hello@swarmia.com to join the waitlist.
Pull requests from the Codex cloud agent and reviews from Codex are detected from your pull request data, so those work on any plan.
Why do you need an admin key? Isn't that a bit excessive?
We build our integrations with the principle of least privilege. The Codex Enterprise Analytics API is only reachable with an admin key, but you can restrict the one you give us to a single workspace and two read scopes: codex.enterprise.analytics.read, and chatgpt.enterprise.usage_limit.read.
You can read more about our data access here.
Why doesn't anyone show up as idle in AI adoption?
The Codex Enterprise Analytics API reports usage, not seats, so Swarmia can't tell a person who has a Codex seat and doesn't use it apart from someone who has no seat at all. For Codex, enabled users only include active users, and idle seats aren't shown.
The same limitation applies to Claude Code OpenTelemetry monitoring.
Why is a Codex review missing from a pull request?
Swarmia counts a Codex review only when Codex leaves inline findings. Read more about why a Codex review can be missing.
Why doesn't someone's Codex usage show up on their contributor?
Swarmia creates a Codex identity from the Codex user ID and, when the API reports one, the email address. Identities are merged into the right contributor by email, so an account without an email or with one that doesn't match the person's other identities stays separate.
Merge it by hand in the Contributor settings: search for the person, select both the Codex identity and the contributor, and click Merge.
Can I connect more than one Codex workspace?
No. Swarmia connects one ChatGPT workspace per organization, and the workspace ID is locked once it's set. Contact us at hello@swarmia.com to connect a different workspace.
How long does it take for Codex data to show up?
The first sync starts as soon as you connect, so your history lands shortly after. After that, Codex usage is synced daily, so new activity shows up within a day.
What happens if I disable the integration?
Swarmia stops syncing new data and keeps everything it has already collected. Reconnecting the same workspace continues the sync from where it left off.
If your admin key stops working, for example because it expired or was revoked, Swarmia disables the integration the same way and emails your organization admins so you can reconnect.
Last updated
Was this helpful?