---
title: "OpenAI Codex (Enterprise)"
canonical_url: "https://docs.getdx.com/connectors/codex-enterprise/"
md_url: "https://docs.getdx.com/connectors/codex-enterprise.md"
last_updated: "2026-05-08"
---

# 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](https://docs.getdx.com/schema/) 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 **Platform API key** with the `codex.enterprise.analytics.read` scope.
- your **Codex Workspace ID**.

**Note:** To obtain a Platform API key with the required scope, you must contact OpenAI support at [support@openai.com](mailto:support@openai.com). This key cannot be self-served through the OpenAI dashboard.

## Setup instructions

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

#### Step 1

Contact OpenAI at [support@openai.com](mailto:support@openai.com) to request a Platform API key with the `codex.enterprise.analytics.read` scope.

#### Step 2

Locate your **Workspace ID**. This can be found in your OpenAI Enterprise dashboard or obtained from your OpenAI account team.

#### 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 API 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**.
- Credit consumption is tracked, but OpenAI does not currently provide a direct dollar mapping for Codex credits.

## 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](https://developers.openai.com/codex/enterprise/governance#analytics-api) |


## Errors

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


| Error | Description |
|----------------------|------------------------------------------------------------------------------------------------------------------|
| `invalid_credentials` | Your API 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 API key has the correct scope and the Workspace ID is accurate. |
---

## Sitemap

[Overview of all docs pages](/llms.txt)
