1010from langchain_core .outputs import ChatGeneration , LLMResult
1111
1212MODEL_COST_PER_1K_TOKENS = {
13+ # GPT-5 input
14+ "gpt-5" : 0.00125 ,
15+ "gpt-5-cached" : 0.000125 ,
16+ "gpt-5-2025-08-07" : 0.00125 ,
17+ "gpt-5-2025-08-07-cached" : 0.000125 ,
18+ # GPT-5 output
19+ "gpt-5-completion" : 0.01 ,
20+ "gpt-5-2025-08-07-completion" : 0.01 ,
21+ # GPT-5-mini input
22+ "gpt-5-mini" : 0.00025 ,
23+ "gpt-5-mini-cached" : 0.000025 ,
24+ "gpt-5-mini-2025-08-07" : 0.00025 ,
25+ "gpt-5-mini-2025-08-07-cached" : 0.000025 ,
26+ # GPT-5-mini output
27+ "gpt-5-mini-completion" : 0.002 ,
28+ "gpt-5-mini-2025-08-07-completion" : 0.002 ,
29+ # GPT-5-nano input
30+ "gpt-5-nano" : 0.00005 ,
31+ "gpt-5-nano-cached" : 0.000005 ,
32+ "gpt-5-nano-2025-08-07" : 0.00005 ,
33+ "gpt-5-nano-2025-08-07-cached" : 0.000005 ,
34+ # GPT-5-nano output
35+ "gpt-5-nano-completion" : 0.0004 ,
36+ "gpt-5-nano-2025-08-07-completion" : 0.0004 ,
37+ # GPT-5-chat-latest input
38+ "gpt-5-chat-latest" : 0.00125 ,
39+ "gpt-5-chat-latest-cached" : 0.000125 ,
40+ "gpt-5-chat-latest-2025-08-07" : 0.00125 ,
41+ "gpt-5-chat-latest-2025-08-07-cached" : 0.000125 ,
42+ # GPT-5-chat-latest output
43+ "gpt-5-chat-latest-completion" : 0.01 ,
44+ "gpt-5-chat-latest-2025-08-07-completion" : 0.01 ,
1345 # GPT-4.1 input
1446 "gpt-4.1" : 0.002 ,
1547 "gpt-4.1-2025-04-14" : 0.002 ,
@@ -319,7 +351,8 @@ def standardize_model_name(
319351 if "ft:" in model_name :
320352 model_name = model_name .split (":" )[1 ] + "-finetuned"
321353 if token_type == TokenType .COMPLETION and (
322- model_name .startswith ("gpt-4" )
354+ model_name .startswith ("gpt-5" )
355+ or model_name .startswith ("gpt-4" )
323356 or model_name .startswith ("gpt-3.5" )
324357 or model_name .startswith ("gpt-35" )
325358 or model_name .startswith ("o1-" )
@@ -331,7 +364,8 @@ def standardize_model_name(
331364 if (
332365 token_type == TokenType .PROMPT_CACHED
333366 and (
334- model_name .startswith ("gpt-4o" )
367+ model_name .startswith ("gpt-5" )
368+ or model_name .startswith ("gpt-4o" )
335369 or model_name .startswith ("gpt-4.1" )
336370 or model_name .startswith ("o1" )
337371 or model_name .startswith ("o3" )
0 commit comments