Skip to main content
or-otel sends usage from Claude Code (terminal and Claude Desktop) and Codex (terminal and desktop app) to OpenReason, so you can see usage and cost by organization, team, and user. Requests still go directly to Anthropic or OpenAI and are billed to your own subscription. To bill requests to your org and apply budgets instead, use claude-or.
Once set up, every Claude Code and Codex session on your Mac reports its model, token counts, and prompt text to OpenReason. To send usage without prompt text, see What gets sent.

Prerequisites

Works with Claude Code and Codex whether they’re pre-installed or newly installed after setup.

Install

1

Run the installer

Open Terminal and run:
  • Enter your password for sudo when asked. This installs or-otel to /usr/local/bin.
  • Paste your OpenReason API key when asked. Nothing shows while you paste — that’s expected.
  • Enter your sudo password again if asked. This writes the Claude Code and Codex config.
The installer checks your key against the router and ends with:

Restart your AI tools (required)

Usage isn’t tracked until you restart. Sessions left open from before setup keep their old settings.
  • Claude Desktop and Codex app: fully quit with Cmd+Q (closing the window isn’t enough), then reopen.
  • Claude Code and Codex CLI: open a new terminal window and start a new session.
3

Check it works

Every line should show ✓, ending with router accepts exports.Then send one prompt from each tool you use, in a new terminal:
Open Audit Log → Events in the OpenReason dashboard. New rows appear within about 30 seconds, with the model, token counts, and your prompt.

Install options

Pass options to or-otel setup after bash -s --, or set environment variables before bash:
Usage only, no prompt text
Key up front (CI, MDM, scripted rollout)
A different router
Use OR_ROUTER_URL only if your admin gives you a router URL. The default is https://api.openreason.app.

What gets sent

Prompt and response text is redacted for secrets and kept up to 256k characters each. Longer text is cut and the row is marked truncated. To send usage only, without text:
The choice is remembered across updates. Run or-otel setup --log-prompts to turn text back on.

Commands

Update

Re-running the install command does the same thing. Both keep your saved key, router, and prompt setting.

Uninstall

Confirms with [y/N], then removes the Claude Code and Codex telemetry config, your saved key (~/.openreason/otel), and or-otel itself. Claude Code and Codex stay installed and work as normal. Fully quit and reopen them afterwards.

Troubleshooting

Check your network or VPN, and that the install URL is the one your admin gave you.
Open a new terminal. /usr/local/bin is on the default macOS PATH. If you’ve changed yours, run the full path:
Setup shows rejected this key, or or-otel doctor shows router rejects the key. The key is invalid, revoked, or doesn’t match the router — for example, a development key against production.Create a new key at admin.openreason.app/dashboard/api-keys, then re-run setup and paste it:
If your admin gave you a different router, add --router https://<router-url>.
OpenReason API keys start with sk-or_. Copy the full key from admin.openreason.app/dashboard/api-keys and re-run or-otel setup.
Check your network or VPN and retry. If it persists, tell your OpenReason admin — the router may be down.
The config was written by an older or-otel. Update it:
Fully quit (Cmd+Q) and reopen the tool, then start a new session. Terminals must be opened after setup to pick up the config.
Your company manages Claude Code or Codex centrally, and those settings take priority over or-otel. Ask your IT team.
For anything else, send the output of or-otel doctor to your OpenReason admin.

For admins

or-otel setup writes each tool’s managed (admin) config. Managed config sits above the user’s own ~/.claude and ~/.codex settings, so it covers existing and future installs, and users can’t switch it off from their own settings.The managed config files hold the user’s key and are readable by other local accounts. On shared machines, push the same settings through MDM instead.
Pass the key up front to skip every prompt except sudo:
Skip the installer and deploy configuration profiles instead:
  • com.anthropic.claudecode — the same keys as the Claude Code JSON file above.
  • com.openai.codex — config_toml_base64 holding the [otel] block, and requirements_toml_base64 holding the Stop hook for Codex replies. or-otel must still be installed for the hook to run.
An MDM profile overrides the files or-otel writes. or-otel setup and or-otel status warn when one is installed.
If your org sends any settings from the claude.ai admin console, Claude Code takes managed settings from there first. or-otel puts the auth header in env for this reason, because env is still merged from the local file.To have the whole local file apply, set "managedSourcesBehavior": "merge" in the claude.ai admin console.

Next

Claude Code with OpenReason

Route Claude Code through OpenReason instead, so prompts bill to your org’s key and per-user budgets apply.