Skip to content

Commit 9fcee91

Browse files
committed
fix(codex): apply GPT-6 Sol, GPT-6.1 Sol and GPT-6 Luna fast multipliers
OpenAI documents Fast mode for these models at 2x the Standard rates, and LiteLLM lists their priority prices at 2x, but they had no fast multiplier override, so Fast usage was priced as Standard. Fixes #1852
1 parent b2a3cb0 commit 9fcee91

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

‎docs/guide/codex/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ By default, `ccusage codex` uses `--speed auto`. Codex CLI 0.144.0 and later can
7272

7373
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.
7474

75-
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), and GPT-6 Astra uses its [documented 2× Fast rate](https://developers.openai.com/api/docs/models/gpt-6-astra). 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.
75+
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), and GPT-6 [Astra](https://developers.openai.com/api/docs/models/gpt-6-astra), [Sol](https://developers.openai.com/api/docs/models/gpt-6-sol), and [Luna](https://developers.openai.com/api/docs/models/gpt-6-luna) and [GPT-6.1 Sol](https://developers.openai.com/api/docs/models/gpt-6.1-sol) use their documented 2× Fast rates. 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.
7676

7777
```bash
7878
# Default: use recorded tiers, then config.toml for unmarked usage

‎rust/adapters/codex/src/lib.rs‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,27 @@ mod tests {
677677
assert!((fast - 4.0).abs() < f64::EPSILON);
678678
}
679679

680+
#[test]
681+
fn applies_documented_gpt_6_fast_multipliers() {
682+
let pricing = PricingMap::load_embedded();
683+
let usage = CodexModelUsage {
684+
input_tokens: 1_000_000,
685+
cached_input_tokens: 500_000,
686+
output_tokens: 100_000,
687+
total_tokens: 1_100_000,
688+
..CodexModelUsage::default()
689+
};
690+
691+
for model in ["gpt-6-sol", "gpt-6.1-sol", "gpt-6-luna"] {
692+
let standard =
693+
calculate_codex_model_cost(model, &usage, &pricing, CodexSpeed::Standard);
694+
let fast = calculate_codex_model_cost(model, &usage, &pricing, CodexSpeed::Fast);
695+
696+
assert!(standard > 0.0, "{model} has embedded pricing");
697+
assert!((fast - (standard * 2.0)).abs() < 1e-9, "{model}");
698+
}
699+
}
700+
680701
#[test]
681702
fn uses_recorded_service_tiers_in_auto_mode() {
682703
let mut pricing = PricingMap::default();

‎rust/crates/ccusage-core/src/fast-multiplier-overrides.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"gpt-5.5": 2.5,
77
"gpt-5.4": 2.0,
88
"gpt-5.3-codex": 2.0,
9-
"gpt-6-astra": 2.0
9+
"gpt-6-astra": 2.0,
10+
"gpt-6-sol": 2.0,
11+
"gpt-6.1-sol": 2.0,
12+
"gpt-6-luna": 2.0
1013
},
1114
"normalized_prefix": {
1215
"claude-opus-4-6": 6.0,

0 commit comments

Comments
 (0)