OpenAI Codex

Supported OS Linux Windows Mac OS

Integration version1.0.0

To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email support@ddog-gov.com.

Overview

OpenAI Codex is OpenAI’s enterprise AI coding agent. This integration collects per-user, per-day Codex activity from the Codex Analytics API, reports it to Datadog as standard metrics, and uses it to attribute AI-assisted pull requests in AI Impact. Engineering leaders can measure Codex adoption and correlate it with software delivery performance.

What this integration collects

The integration polls the Codex Analytics API once per day for each enterprise workspace and emits metrics under the openai.codex.* namespace:

  • Usage totals: Threads, turns, credits, and token counts for each engineer.
  • Usage breakdowns: Token counts by model, and thread and turn counts by client.
  • Code attribution: Lines of code added and removed that are attributable to Codex.
  • Code reviews: Reviews completed and review comments by priority, with the reactions and replies those comments receive.
  • User engagement: A daily per-engineer signal that AI Impact uses to attribute AI assistance.

Spend and dollar amounts are not collected. Credits reflect consumed Codex credits, not a currency amount.

Dashboards and monitors

  • An OpenAI Codex Overview dashboard for usage, token consumption by model, client activity, code attribution, and code reviews.
  • A recommended monitor that alerts when usage metrics stop reporting.
  • Delivery Performance Explorer, available when you enable AI Impact.

Use cases

  • Track Codex adoption, token consumption, and engagement across teams and models.
  • Measure how much code Codex contributes and how its reviews are received.
  • Segment deployment frequency, lead time, change failure rate, and mean time to restore by Codex engagement.

Setup

Prerequisites

  • An active OpenAI enterprise subscription with Codex enabled.
  • Workspace admin access to the Codex enterprise admin portal.
  • An API key with the codex.enterprise.analytics.read scope. This scope is assigned by OpenAI Support and is not self-serve.

Get your Codex credentials

  1. Sign in to your Codex enterprise admin portal.
  2. Create an API key with a descriptive name, such as Codex Datadog Integration.
  3. Email support@openai.com with your organization name, the key name, and your Codex Workspace ID, and request the codex.enterprise.analytics.read scope. Wait for confirmation before continuing.
  4. Copy your Workspace ID from your Codex workspace settings.

Configure the integration in Datadog

  1. In Datadog, go to Integrations and open the OpenAI Codex tile.
  2. Click Install, or click Configure if the tile is already installed.
  3. Enter your Codex API Key and Codex Workspace ID.
  4. To also send engagement data to AI Impact, select Use for attribution in AI Impact.
  5. Click Save.

The integration collects usage, code-attribution, and code-review metrics automatically after you configure the account. Allow about 24 hours, then open the OpenAI Codex Overview dashboard to confirm that usage metrics appear. If you enabled AI Impact, also check the Delivery Performance Explorer.

Data Collected

Metrics

openai.codex.usage.threads
(count)
Codex threads (conversations) started by the user that day
openai.codex.usage.turns
(count)
User turns (messages) sent across Codex threads that day
openai.codex.usage.credits
(count)
Codex credits consumed by the user that day
openai.codex.usage.tokens.uncached_input
(count)
Uncached text input tokens processed by the user that day
openai.codex.usage.tokens.cached_input
(count)
Cached text input tokens processed by the user that day
openai.codex.usage.tokens.output
(count)
Text output tokens generated for the user that day
openai.codex.usage.tokens.total
(count)
Total text tokens (input and output) processed for the user that day
openai.codex.usage.by_model.tokens.uncached_input
(count)
Uncached text input tokens broken down by model
openai.codex.usage.by_model.tokens.cached_input
(count)
Cached text input tokens broken down by model
openai.codex.usage.by_model.tokens.output
(count)
Text output tokens broken down by model
openai.codex.usage.by_model.tokens.total
(count)
Total text tokens broken down by model
openai.codex.usage.by_client.threads
(count)
Codex threads started via this client (for example, cli, ide, or web)
openai.codex.usage.by_client.turns
(count)
User turns sent via this client (for example, cli, ide, or web)
openai.codex.usage.code_attribution.lines_added
(count)
Lines of code added attributable to Codex that day
openai.codex.usage.code_attribution.lines_removed
(count)
Lines of code removed attributable to Codex that day
openai.codex.code_reviews.completed
(count)
Pull request reviews completed by Codex
openai.codex.code_reviews.comments.total
(count)
Total review comments left by Codex
openai.codex.code_reviews.comments.p0
(count)
P0 (highest priority) review comments left by Codex
openai.codex.code_reviews.comments.p1
(count)
P1 review comments left by Codex
openai.codex.code_reviews.comments.p2
(count)
P2 review comments left by Codex
openai.codex.code_review_responses.reactions.upvotes
(count)
Upvote reactions received on Codex review comments
openai.codex.code_review_responses.reactions.downvotes
(count)
Downvote reactions received on Codex review comments
openai.codex.code_review_responses.reactions.other
(count)
Other reactions received on Codex review comments
openai.codex.code_review_responses.replies
(count)
Codex review comments that received a reply
openai.codex.code_review_responses.engaged
(count)
Codex review comments that were engaged with

Uninstallation

To uninstall, remove all configured accounts from the OpenAI Codex tile in Datadog. Deleting the last account stops all data collection for this integration.

Support

Need help? Contact Datadog Support.

Further Reading