← All Guides·Guide·Updated 2026-11-23·7 min read

How to Check OpenAI Codex CLI Usage & Rate Limits on macOS

Every reliable way to inspect OpenAI Codex 5-hour and weekly quotas, banked resets, and local rollout token logs using codex app-server without touching ~/.codex/auth.json.

If you use OpenAI's Codex CLI on a ChatGPT Plus or Pro plan, your usage is governed by rolling rate-limit windows rather than a simple monthly dollar cap. Knowing how much capacity is left, and when it resets, saves you from getting cut off in the middle of a refactor.

Below are the three reliable ways to check OpenAI Codex usage on macOS, including the exact official JSON-RPC protocol that Codex itself exposes, without letting any tool touch~/.codex/auth.json.

Method 1: Inside an interactive Codex session (/status)

While running Codex interactively in your terminal, type /status to inspect the active account, current model, and rate-limit summary. This works well for one-off checks when you already have a session open, though it does not give you background alerts, pace projections, or a persistent menu-bar view across multiple terminals.

Method 2: Query the official codex app-server over stdio

Since rust-v0.48.0, the Codex CLI ships an official, documentedapp-server mode designed for IDE and local tool integrations. You can inspect the exact schema emitted by your installed CLI at any time:

codex app-server generate-json-schema

To read account details and rate limits safely in read-only mode (with zero approvals and zero model turns), launch codex -s read-only -a never app-server and exchange newline-delimited JSON-RPC frames on stdin/stdout:

// 1. Handshake
{"id":1,"method":"initialize","params":{"clientInfo":{"name":"my_checker","version":"1.0"}}}
{"method":"initialized"}

// 2. Read account plan & identity (without forcing token refresh)
{"id":2,"method":"account/read","params":{"refreshToken":false}}

// 3. Read current rate-limit windows & banked reset credits
{"id":3,"method":"account/rateLimits/read","params":{"excludeResetCreditDetails":true}}

Understanding the account/rateLimits/read fields

  • primary & secondary windows: Each window returns usedPercent (an integer that may exceed 100 when overdrawn),windowDurationMins (300 for the 5-hour window, 10080for the 7-day weekly window), and resetsAt (Unix epoch seconds).
  • Extra model-specific buckets: Additional keys insiderateLimitsByLimitId represent model-scoped limits labelled bylimitName.
  • rateLimitResetCredits.availableCount: Reports how many banked resets are available on eligible plans. A reset can be redeemed explicitly viaaccount/rateLimitResetCredit/consume with an idempotency key.
  • API-key vs. ChatGPT accounts: When account.type is notchatgpt (for example direct API key, Bedrock, or GCP), subscription rate-limit windows do not apply because billing is metered per token instead.
Why codex app-server beats reading ~/.codex/auth.json:When a third-party app calls codex app-server, the Codex CLI manages its own sign-in and talks to OpenAI itself. The monitoring app never reads your OAuth tokens, never touches Keychain items, and never relies on undocumented web endpoints.

Method 3: Inspect local Codex token logs (rollout-*.jsonl)

If you want token counts per day or per model (which are distinct from subscription quota), Codex writes local session transcripts under $CODEX_HOME/sessions/**/rollout-*.jsonl(defaulting to ~/.codex/sessions/).

Two subtle details trip up quick shell scripts when parsing Codex logs:

  1. Running totals, not deltas: event_msg /token_count entries carry cumulative total_token_usage counters. You must subtract the previous total in the same file to get each turn's actual increment.
  2. Cached input is nested inside input tokens: Codex counts cached prompt tokens inside its reported input count. If you estimate cost at OpenAI API list rates without subtracting cached tokens from fresh input first, you will double-count cached input and overstate the equivalent API cost.

Tracking multiple Codex accounts on one Mac

Codex isolates credentials and session logs by the CODEX_HOME environment variable. To keep work and personal ChatGPT accounts separate:

CODEX_HOME=~/.codex-work codex login
CODEX_HOME=~/.codex-work codex -s read-only -a never app-server

Running codex app-server with that CODEX_HOME returns that specific account's plan, windows, and banked resets without logging out of your default profile.

Automatic menu-bar monitoring on macOS

RateLimitBar automates this exact codex app-server exchange on a configurable schedule (default 90 seconds, plus on-open and after wake) with a 20-second process watchdog so a stalled CLI never hangs your Mac. It shows 5-hour and weekly meters, pace projections, banked reset counts (with confirmed one-click redemption), multiple CODEX_HOME accounts, and optional local token-activity tables, all without touching a single credential file.

Want to compare Codex Plus/Pro against raw OpenAI API pricing? Try theClaude & Codex Limit Calculator.

See your limits in the macOS menu bar

RateLimitBar: $15 one-time

Native SwiftUI menu-bar monitor for Claude Code & OpenAI Codex. Official CLI sources only, zero credential reads, 7-day free trial.

Download 7-day trialOpen Calculator

Related guides & tools