Skip to main content

Codex CLI cost tracking

Per-session Codex spend, attributed to the developer who ran it, in the same place as the rest of your AI bill. One config file per developer.

What Acticly reads

  • Session logs and metrics over OpenTelemetry — model, tokens, and timing.
  • Prompts stay local: the config sets `log_user_prompt = false` and forces the trace exporter off.

What you get

  • Cost per developer, per session, and per day.
  • Codex spend totalled with your other agents, rather than a separate invoice to reconcile.
  • Threshold alerts on unusual usage.
  • Codex-assisted commits joined to delivery data.

How to connect

Add an Acticly key to your Codex config. Per developer, once. Both exporters are needed — metrics alone gives cost without session context.

~/.codex/config.toml (Windows: C:\Users\<username>\.codex\config.toml)

[otel]
environment = "prod"
log_user_prompt = false

# Critical: force traces off. Do not rely on default behavior.
trace_exporter = "none"

[otel.exporter.otlp-http]
endpoint = "https://otel.acticly.com/v1/logs"
protocol = "binary"

[otel.exporter.otlp-http.headers]
Authorization = "Bearer <your-acticly-key>"

[otel.metrics_exporter.otlp-http]
endpoint = "https://otel.acticly.com/v1/metrics"
protocol = "binary"

[otel.metrics_exporter.otlp-http.headers]
Authorization = "Bearer <your-acticly-key>"

What this does not cover

  • Prompt content — `log_user_prompt` is off in the configuration above and traces are disabled.
  • Developers who have not added the config file.