← Back to the analyzer
How it’s calculated
- Tokens for each request come from the usage counters Codex writes to the files
rollout-*.jsonl after the model replies. Records with the same response_id are the same response and count only once, even if recorded in two files. Session-level totals are not used: they reset on compaction and resume.
- The context breakdown is an estimate. Before each request, the context is reconstructed. Model replies and reasoning use exact counts; other content is estimated from character counts (Cyrillic ≈0.33 tokens per character, Latin text and code ≈0.27). The coefficients were calibrated against actual input growth between adjacent requests.
- “Not visible in logs” is the remainder: actual request input minus everything reconstructed from the file. It usually includes the system prompt and tool descriptions; after compaction, it may also include an encrypted summary. Character-based estimation error is included here too. The logs cannot identify its exact components or their proportions, so it is not split further. All request categories always sum to the actual input.
- Auto-review (guardian) uses separate sessions in which a model checks the agent’s actions before execution.
- In the session viewer, cached and uncached input are exact counters for the whole step. Logs do not identify which individual blocks were cached. Block highlights show what was added to context for the selected step. A cache-miss marker appears when cached input is smaller than the input read at the previous step; the log does not state the cause.
- Cumulative totals in the session viewer sum cost, tokens and estimated limit share for all requests up to and including the selected step.
- Date ranges and the By day chart assign requests to days in this computer’s time zone. A multi-day session contributes its corresponding cost to each day. With a date range selected, Tokens, API cost, Requests and % week in Sessions cover only those days; other columns cover the entire session.
- Cost is an estimate at OpenAI API Standard rates, not actual charges or subscription limit usage. Fresh input, cached input and output use their respective prices. Above 272K input tokens, input and cache are multiplied by 2 and output by 1.5. Cache writes (×1.25 for GPT-5.6 and newer) use cache_write_input_tokens from newer Codex logs. Older logs lack it: the base estimate prices new input normally, while the alternative scenario prices all of it as cache writes. Requests with no model price are excluded: “—” marks an unpriced request; “*” marks a partially priced session or day.
- Weekly usage uses the counter Codex logs after responses. Only the seven-day window (window_minutes = 10080) is used, regardless of its position; the five-hour window is ignored. Measured: counter increases between accepted readings across all sessions on one timeline. The first reading is existing usage, not new consumption. Late lower readings are skipped, resets_at changes do not carry increases across windows, and unexplained drops leave a gap. Estimated: allocating increases to requests in proportion to their API cost, hence ≈ on sessions and days. Requests outside two readings get no estimate, which is not zero. All logs are assumed to belong to one account.
- “Sent” in the commands table is the command output size multiplied by the number of requests whose context included it.