-
Notifications
You must be signed in to change notification settings - Fork 0
Codex
smajt-archlinux edited this page May 19, 2026
·
1 revision
The Codex provider tracks usage limits for Codex / OpenAI via the official Codex CLI authentication.
All OpenAI plans accessible through Codex CLI (Plus, Pro, Team, etc.) are supported.
Codex uses OAuth tokens from the official codex CLI. You have two options:
opentracker login codexThis runs codex login interactively. After authentication completes:
opentracker fetch codexIf you already have a Codex access token:
export OPENTRACKER_CODEX_ACCESS_TOKEN="your-access-token"
export OPENTRACKER_CODEX_ACCOUNT_ID="your-account-id" # optional
opentracker fetch codexWhen using codex login, tokens are stored by the Codex CLI at:
~/.codex/auth.json
OpenTracker reads this file automatically. The CODEX_HOME environment variable is respected if set.
# Fetch current usage (cached for 90 seconds)
opentracker fetch codex
# Force refresh (skip cache)
opentracker fetch codex --force[
{
"provider": "codex",
"usage": {
"plan": "pro",
"primary": {
"usedPercent": 42,
"remainingPercent": 58,
"windowSeconds": 18000,
"resetsAt": "2025-10-09T08:53:20Z"
},
"secondary": {
"usedPercent": 10,
"remainingPercent": 90,
"windowSeconds": 604800,
"resetsAt": "2025-10-15T12:00:00Z"
},
"creditsRemaining": 150.0,
"updatedAt": "2025-10-09T03:53:20Z",
"source": "codex-oauth"
}
}
]| Field | Type | Description |
|---|---|---|
plan |
string | OpenAI plan type (e.g., plus, pro, team) |
primary |
object | Short-term rate limit window (typically 5 hours) |
secondary |
object | Long-term rate limit window (typically 7 days) |
creditsRemaining |
number | Current credit balance |
updatedAt |
string | ISO 8601 timestamp of when the data was fetched |
source |
string | Always "codex-oauth"
|
| Field | Type | Description |
|---|---|---|
usedPercent |
integer | Percentage of limit used |
remainingPercent |
integer | Percentage of limit remaining |
windowSeconds |
integer | Length of the rate limit window in seconds |
resetsAt |
string | ISO 8601 timestamp when the window resets |
Run codex login first, or set OPENTRACKER_CODEX_ACCESS_TOKEN.
Your token has expired. Run opentracker login codex again to refresh.
The codex CLI is not installed or not in your PATH. Install it first:
npm install -g @openai/codex