You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 65e8005
Browse filesBrowse the repository at this point in the historyBrowse files
Recent rollouts persist explicit Fast and Standard settings. Preserve
those transitions during parsing so mixed-mode reports apply published
rates only to matching requests.
Reconcile copied records before attributing tier buckets so file order
and worker scheduling cannot change cost estimates. Command-line
overrides remain authoritative, with config used only for unclassified
usage.
Copy file name to clipboardExpand all lines: docs/guide/codex/index.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ These views support `--json`, `--compact`, `--offline`, and `--speed auto|standa
48
48
-**Token deltas** – Each `event_msg` with `payload.type === "token_count"` reports cumulative totals and, when available, the latest request delta. Current MultiAgent V2 subagent rollouts can persist a replayed parent-history prefix; the CLI uses the final inherited snapshot as the child baseline, then counts only advancing usage from the child turn. Older Codex replay formats retain timestamp-based compatibility handling.
49
49
-**Per-model grouping** – The active `turn_context` specifies the model for newly counted usage. Replayed parent contexts in current MultiAgent V2 subagent prefixes remain inherited history and do not add model usage to the child. We aggregate tokens per day/month and per model. Sessions lacking model metadata (seen in early September 2025 builds) are skipped.
50
50
-**Pricing** – Rates come from LiteLLM's pricing dataset via the shared `LiteLLMPricingFetcher`. Codex's internal review label is resolved to the newest known model for the log date before pricing is calculated.
51
-
-**Speed pricing** – `--speed auto` is the default. It reads `config.toml` from each `CODEX_HOME` root and applies fastpricing when any Codex config has `service_tier = "priority"`or legacy `service_tier = "fast"` configured. Fast mode applies a model-specific multiplier only when one is available; when the rate is unknown, ccusage reports standard pricing rather than assuming a multiplier, which may underestimate actual Fast usage. Pass `--speed fast` or `--speed standard` to override config-based detection.
51
+
-**Speed pricing** – `--speed auto` is the default. For rollouts written by Codex CLI 0.144.0 and later, ccusage applies recorded `thread_settings_applied` tier changes chronologically: `priority`and legacy `fast` use Fast pricing, while `default` uses Standard pricing. Unmarked usage falls back to `config.toml` detection. Pass `--speed fast`or `--speed standard` to override every recorded tier. Fast pricing uses a model-specific multiplier only when one is available; otherwise, ccusage keeps standard pricing rather than inventing a rate.
52
52
-**Legacy fallback** – Early September 2025 logs that never recorded `turn_context` metadata are still included; the CLI assumes `gpt-5` for pricing so you can review the tokens even though the model tag is missing (the JSON output also marks these rows with `"isFallback": true`).
53
53
-**Cost formula** – Non-cached input uses the standard input price; cached input uses the cache-read price (falling back to the input price when missing); and output tokens are billed at the output price. All prices are per million tokens. Reasoning tokens may be shown for reference, but they are part of the output charge and are not billed separately.
54
54
-**Totals and reports** – Daily, monthly, and session views display per-model breakdowns, overall totals, and optional JSON for automation.
@@ -64,10 +64,14 @@ When Codex emits a model alias, the CLI automatically resolves it through the Li
64
64
65
65
## Speed Pricing
66
66
67
-
Codex logs usually do not include whether a turn used fast mode. By default, `ccusage codex` uses `--speed auto`, reads `config.toml` from each `CODEX_HOME` root, and treats `service_tier = "priority"` or legacy `service_tier = "fast"` as fast pricing when any configured root opts into it. Fast mode applies a model-specific multiplier only when one is available; when the rate is unknown, ccusage reports standard pricing rather than assuming a multiplier, which may underestimate actual Fast usage.
67
+
By default, `ccusage codex` uses `--speed auto`. Codex CLI 0.144.0 and later can persist `thread_settings_applied` events in session rollouts. ccusage associates each token event with the most recent recognized setting: `service_tier = "priority"` or legacy `"fast"` is Fast, and `"default"` is Standard. This supports sessions that switch modes over time instead of applying one multiplier to the entire day or session.
68
+
69
+
Some usage remains unclassified, including older rollouts, saved headless `codex exec --json` output, and startup usage before the first persisted settings event. For only that unclassified portion, auto mode reads `config.toml` from each `CODEX_HOME` root and uses Fast when any root has `service_tier = "priority"` or legacy `service_tier = "fast"`; otherwise it uses Standard. An unsupported recorded tier is also left unclassified rather than inheriting a stale Fast value. Explicit `--speed fast` and `--speed standard` override all recorded and fallback tiers.
70
+
71
+
Fast pricing uses a model-specific multiplier only when one is published. GPT-5.6 Sol, Terra, and Luna use the [documented 2× API Priority rate](https://learn.chatgpt.com/docs/agent-configuration/speed#fast-mode). This is distinct from the 2.5× ChatGPT credit-consumption rate shown for GPT-5.6 Fast mode: ccusage's `costUSD` is an API-equivalent estimate, not a ChatGPT credit balance. When a model's Fast rate is unknown, ccusage reports standard pricing rather than assuming a multiplier, which may underestimate actual Fast usage.
68
72
69
73
```bash
70
-
# Default: read Codex config.toml
74
+
# Default: use recorded tiers, then config.toml for unmarked usage
Copy file name to clipboardExpand all lines: rust/crates/ccusage-cli/src/snapshots/ccusage_cli__tests__codex_daily_help.snap
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ OPTIONS:
14
14
-z, --timezone <timezone> Timezone for date grouping (IANA)
15
15
-O, --offline Use cached pricing data instead of fetching from LiteLLM (default: false)
16
16
--no-offline Negatable of -O, --offline
17
-
--speed [speed] Cost speed tier: auto reads Codex config.toml service_tier; use standard or fast to override (default: auto, choices: auto | standard | fast)
17
+
--speed [speed] Cost speed tier: auto uses recorded settings, then Codex config.toml; use standard or fast to override (default: auto, choices: auto | standard | fast)
18
18
--compact Force compact table layout for narrow terminals (default: false)
19
19
--no-cost Hide cost information in table and JSON output (default: false)
20
20
--color Enable colored output. FORCE_COLOR=1 has the same effect. (default: auto)
- Token usage inherits the latest recognized setting in the rollout. Missing or unsupported settings remain unclassified so report policy can apply its documented fallback.
0 commit comments