View all connectors

OpenAI Codex (Enterprise)

By integrating OpenAI Codex (Enterprise) with DX, you can import daily usage metrics for your Codex workspace and link this data to the rest of your DX data to analyze impact. Please refer to the API documentation below and our schema explorer to see what data DX imports—note that DX does not read or access your source code.

Prerequisites

To connect OpenAI Codex (Enterprise) to DX, you need:

  • an OpenAI Enterprise plan with Codex access.
  • a workspace-scoped Admin key with the codex.enterprise.analytics.read scope.
  • your Codex Workspace ID.

Note: Admin keys are now self-served. Workspace owners and workspace admins can create the required key directly in the OpenAI Admin Console at admin.openai.com—you no longer need to contact OpenAI support. The secret is shown only once, so copy and store it securely when it is created.

Setup instructions

Follow the steps below to connect OpenAI Codex (Enterprise) to DX.

Step 1

As a workspace owner or workspace admin, open the OpenAI Admin Console at admin.openai.com and navigate to CredentialsAdmin keys, then:

  • Select Create new admin key.
  • Choose the workspace the key should access.
  • Under permissions, select Restricted and add the codex.enterprise.analytics.read scope.
  • Copy the secret immediately—it is shown only once—and store it securely.

Step 2

Locate your Workspace ID. ChatGPT admins and Codex admins can open the ChatGPT Admin Console at chatgpt.com/admin and copy the Workspace ID from the workspace settings page.

Step 3

  • Navigate to the connections page in DX and select “+ Connection” in the top right.
  • Select “OpenAI Codex (Enterprise)” as the connector type.
  • Enter your Admin key and Workspace ID in the credentials fields—refer to the information below for errors and troubleshooting.

Data availability

  • All data is aggregated per user, per day.
  • Token metrics include uncached text input tokens, cached text input tokens, text output tokens, and total text tokens.
  • Credit consumption is tracked, but OpenAI does not currently provide a direct dollar mapping for Codex credits.

In AI cost management, Codex contributes token usage but not estimated cost.

API reference

The table below lists the specific API endpoints that are used by DX.

Endpoint Documentation
GET /v1/analytics/codex/workspaces/{workspace_id}/usage Link

Errors

The table below lists potential error codes when adding a connection in DX.

Error Description
invalid_credentials Your Admin key or Workspace ID is not valid. Ensure the key has the codex.enterprise.analytics.read scope.
no_resources No usage data was found. Ensure the Admin key has the correct scope and the Workspace ID is accurate.