Skip to content
Jents Academy
Connect your AI 3 min read

Connect OpenAI Codex

Get OpenAI Codex into Jents

Codex is a coding tool your developers run โ€” not a place that hosts agents. It can export OpenTelemetry, so Jents measures it exactly the way it measures Claude Code: the calls still go straight to OpenAI, and Codex simply reports the tokens it used. Nothing changes on your call path, and it works on any Codex โ€” including a ChatGPT subscription.

What you get
Connects by๐Ÿ“ฎ Telemetry (metrics)
Cost$0 per call, on purpose โ€” Codex is seat-billed, so the tokens are kept as value instead
AttributionPer person, from the attributes you set in step 3
NeedsAny Codex โ€” including a ChatGPT subscription โ€” and one block in ~/.codex/config.toml
Changes your call pathNo โ€” calls still go straight to OpenAI

Routing Codex through a Jents-hosted gateway isn't on offer right now. This guide used to open with it as "Option A"; it is gone rather than left sitting there looking available. Telemetry already tells you who used Codex and how much, without putting us between your developers and OpenAI โ€” and if you want exact dollars and the person on the same call, that is your own gateway, not ours: see Connect your own gateway (BYOG).


1. Get your capture key

Add AI source โ†’ "AI your team uses" โ†’ Generate an Activation key. Copy the key. Codex needs the full metrics endpoint: https://app.jents.io/api/capture/v1/metrics.

2. Turn on OTel metrics in Codex

In ~/.codex/config.toml. Token usage is a metric, so metrics_exporter must be set โ€” that's the important line:

[otel]
environment = "prod"

[otel.metrics_exporter.otlp-http]
endpoint = "https://app.jents.io/api/capture/v1/metrics"
protocol = "json"
headers = { Authorization = "Bearer YOUR-ACTIVATION-KEY" }

Three things Codex is fussy about, and all three are silent if you get them wrong: it must be metrics_exporter (tokens are a metric โ€” plain exporter is the logs one, and metrics default to OpenAI's own endpoint); it must be a table, [otel.metrics_exporter.otlp-http], not metrics_exporter = "otlp-http"; and the endpoint is used exactly as written, so unlike Claude Code it needs the full /v1/metrics path.

3. Tell Jents who's who

So usage attributes to the right person and team, set these before running Codex (add them to your shell profile to make it stick):

export OTEL_RESOURCE_ATTRIBUTES="user.email=you@company.com,jents.team=Engineering"

4. Use Codex + confirm

Run Codex normally. Its usage โ€” who ran it, tokens, models โ€” shows up in Observability within a minute or two, and the people Jents sees become Codex seat holders on Observability โ†’ Subscriptions.

Prompt text stays private unless you explicitly set log_user_prompt = true.


Why the cost reads $0

Because it should. Codex comes with a ChatGPT plan, so the money is the seat, which Jents already counts once under Observability โ†’ Subscriptions. Pricing the tokens on top of that would bill you twice. Jents keeps the token figure as value โ€” what that usage would have cost pay-as-you-go โ€” so you can still weigh a seat against what it produced.

Set the real plan on Observability โ†’ Subscriptions (ChatGPT Plus or Pro) and that seat cost flows into your budgets, forecast and per-person spend. The paid roster comes from the same OpenAI Admin key you'd paste on the Connections page to import your bill.

Next in Connect your AI
Connect Claude Cowork