Skip to content

Commit ac3121a

Browse files
committed
fix: update model pricing to current 2026 rates (GPT-5.4, Claude 4.6, Qwen3, etc.)
1 parent e1200ea commit ac3121a

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

corecoder/llm.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,33 @@ def message(self) -> dict:
4646

4747

4848
# pricing per million tokens: (input, output)
49+
# sources: openai.com/api/pricing, api-docs.deepseek.com, platform.claude.com,
50+
# platform.moonshot.ai, alibabacloud.com/help/en/model-studio
4951
_PRICING = {
50-
"gpt-4o": (2.5, 10),
51-
"gpt-4o-mini": (0.15, 0.6),
52+
# OpenAI - current flagships
53+
"gpt-5.4": (2.5, 15),
54+
"gpt-5.4-mini": (0.75, 4.5),
55+
"gpt-5.4-nano": (0.2, 1.25),
56+
"o4-mini": (1.1, 4.4),
57+
# OpenAI - previous gen (still widely used)
5258
"gpt-4.1": (2, 8),
5359
"gpt-4.1-mini": (0.4, 1.6),
5460
"gpt-4.1-nano": (0.1, 0.4),
55-
"o3": (2, 8),
56-
"o4-mini": (1.1, 4.4),
61+
"gpt-4o": (2.5, 10),
62+
"gpt-4o-mini": (0.15, 0.6),
63+
# DeepSeek
5764
"deepseek-chat": (0.27, 1.10),
5865
"deepseek-reasoner": (0.55, 2.19),
66+
# Anthropic Claude
67+
"claude-opus-4-6": (5, 25),
5968
"claude-sonnet-4-6": (3, 15),
60-
"claude-opus-4-6": (15, 75),
61-
"claude-haiku-4-5": (0.8, 4),
62-
"qwen-max": (1.6, 6.4),
63-
"kimi-k2.5": (0.7, 2.8),
69+
"claude-haiku-4-5": (1, 5),
70+
# Alibaba Qwen
71+
"qwen3-max": (0.78, 3.9),
72+
"qwen3-plus": (0.26, 0.78),
73+
"qwen-max": (0.78, 3.9),
74+
# Moonshot Kimi
75+
"kimi-k2.5": (0.6, 3),
6476
}
6577

6678

tests/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ def test_list_sessions():
104104
def test_cost_estimation_known_model():
105105
from corecoder.llm import LLM
106106
llm = LLM.__new__(LLM)
107-
llm.model = "gpt-4o"
107+
llm.model = "gpt-5.4"
108108
llm.total_prompt_tokens = 1_000_000
109109
llm.total_completion_tokens = 500_000
110110
cost = llm.estimated_cost
111111
assert cost is not None
112-
assert cost == 2.5 + 5.0 # $2.5/M in + $10/M out * 0.5M
112+
assert cost == 2.5 + 7.5 # $2.5/M in + $15/M out * 0.5M
113113

114114
def test_cost_estimation_unknown_model():
115115
from corecoder.llm import LLM

0 commit comments

Comments
 (0)