Skip to content

Commit db4fc92

Browse files
committed
docs(codex): clarify pricing fallback and reasoning tokens
1 parent 83e2d14 commit db4fc92

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/codex/CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
-## Cost Calculation
1919

2020
- Pricing is pulled from LiteLLM's public JSON (`model_prices_and_context_window.json`).
21-
- The CLI trusts the model metadata emitted in each `turn_context`. Sessions missing that metadata (observed in early September 2025 builds) should be skipped rather than attempting a fallback.
21+
- The CLI trusts the model metadata emitted in each `turn_context`. Sessions missing that metadata (observed in early September 2025 builds) fall back to `gpt-5` so the tokens remain visible, but the pricing should be considered approximate. These events are tagged with `isFallbackModel === true` and surface as `isFallback` in aggregated JSON.
2222
- Per-model pricing is fetched through the shared `LiteLLMPricingFetcher` with an offline cache macro scoped to Codex-prefixed models. Aliases (e.g. `gpt-5-codex → gpt-5`) are handled in `CodexPricingSource` for pricing parity.
2323
- Cost formula per model/date:
2424
- Non-cached input: `(input_tokens - cached_input_tokens) / 1_000_000 * input_cost_per_mtoken`.

‎apps/codex/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Useful environment variables:
5151
- `LOG_LEVEL` – controla consola log verbosity (0 silent … 5 trace)
5252

5353
ℹ️ The CLI now relies on the model metadata recorded in each `turn_context`. Sessions emitted during early September 2025 that lack this metadata are skipped to avoid mispricing. Newer builds of the Codex CLI restore the model field, and aliases such as `gpt-5-codex` automatically resolve to the correct LiteLLM pricing entry.
54+
📦 For legacy JSONL files that never emitted `turn_context` metadata, the CLI falls back to treating the tokens as `gpt-5` so that usage still appears in reports (pricing is therefore approximate for those sessions). In JSON output you will also see `"isFallback": true` on those model entries.
5455

5556
## Features
5657

0 commit comments

Comments
 (0)