@@ -36,6 +36,13 @@ assert.deepEqual(bundledGpt55Standard.price.tiered, [
3636 { kind : 'cache_read_input_token_cost' , thresholdTokens : 272_000 , costPerMToken : 1 } ,
3737 { kind : 'output_cost_per_token' , thresholdTokens : 272_000 , costPerMToken : 45 } ,
3838] ) ;
39+ const bundledGpt55ProStandard = bundledStandard . getPricing ( 'gpt-5.5-pro' ) ;
40+ assert . equal ( bundledGpt55ProStandard . price . cachedInputCostPerMToken , 30 ) ;
41+ assert . deepEqual ( bundledGpt55ProStandard . price . tiered , [
42+ { kind : 'input_cost_per_token' , thresholdTokens : 272_000 , costPerMToken : 60 } ,
43+ { kind : 'cache_read_input_token_cost' , thresholdTokens : 272_000 , costPerMToken : 60 } ,
44+ { kind : 'output_cost_per_token' , thresholdTokens : 272_000 , costPerMToken : 270 } ,
45+ ] ) ;
3946assert . deepEqual ( bundledStandard . metadata . billingThresholds , [ 272_000 ] ) ;
4047assertClose (
4148 calculateCostFromUsageOrEvents (
@@ -51,13 +58,35 @@ assert.deepEqual(bundledGpt54Standard.price.tiered, [
5158 { kind : 'cache_read_input_token_cost' , thresholdTokens : 272_000 , costPerMToken : 0.5 } ,
5259 { kind : 'output_cost_per_token' , thresholdTokens : 272_000 , costPerMToken : 22.5 } ,
5360] ) ;
61+ const bundledGpt54ProStandard = bundledStandard . getPricing ( 'gpt-5.4-pro' ) ;
62+ assert . equal ( bundledGpt54ProStandard . price . cachedInputCostPerMToken , 30 ) ;
63+ assert . deepEqual ( bundledGpt54ProStandard . price . tiered , [
64+ { kind : 'input_cost_per_token' , thresholdTokens : 272_000 , costPerMToken : 60 } ,
65+ { kind : 'cache_read_input_token_cost' , thresholdTokens : 272_000 , costPerMToken : 60 } ,
66+ { kind : 'output_cost_per_token' , thresholdTokens : 272_000 , costPerMToken : 270 } ,
67+ ] ) ;
5468
5569const parsedStandard = parseOpenAIDevPricingHtml (
5670 '<div component-export="TextTokenPricingTables" props=""tier":[0,"standard"],[0,"GPT-5.5"],[0,5],[0,0.5],[0,30]"></div>' ,
5771 { tier : 'standard' } ,
5872) ;
5973assert . deepEqual ( parsedStandard [ 'gpt-5.5' ] . tiered , bundledGpt55Standard . price . tiered ) ;
6074
75+ const groupedPricingHtml = [
76+ '<div data-content-switcher-pane="true" data-value="standard">' ,
77+ '<astro-island component-export="GroupedPricingTable" props=""headings":[1,[[0,"Category"],[0,"Model"],[0,"Input"],[0,"Cached input"],[0,"Output"]]],"groups":[1,[[0,{"model":[0,"Codex"],"rows":[1,[[1,[[0,"gpt-5.3-codex"],[0,1.75],[0,0.175],[0,14]]]]]}]]]}"></astro-island>' ,
78+ '</div>' ,
79+ '<div data-content-switcher-pane="true" data-value="priority">' ,
80+ '<astro-island component-export="GroupedPricingTable" props=""headings":[1,[[0,"Category"],[0,"Model"],[0,"Input"],[0,"Cached input"],[0,"Output"]]],"groups":[1,[[0,{"model":[0,"Codex"],"rows":[1,[[1,[[0,"gpt-5.3-codex"],[0,3.5],[0,0.35],[0,28]]]]]}]]]}"></astro-island>' ,
81+ '</div>' ,
82+ ] . join ( '' ) ;
83+ const parsedGroupedStandard = parseOpenAIDevPricingHtml ( groupedPricingHtml , { tier : 'standard' } ) ;
84+ assert . equal ( parsedGroupedStandard [ 'gpt-5.3-codex' ] . inputCostPerMToken , 1.75 ) ;
85+ const parsedGroupedPriority = parseOpenAIDevPricingHtml ( groupedPricingHtml , { tier : 'priority' } ) ;
86+ assert . equal ( parsedGroupedPriority [ 'gpt-5.3-codex' ] . inputCostPerMToken , 3.5 ) ;
87+ assert . equal ( parsedGroupedPriority [ 'gpt-5.3-codex' ] . cachedInputCostPerMToken , 0.35 ) ;
88+ assert . equal ( parsedGroupedPriority [ 'gpt-5.3-codex' ] . outputCostPerMToken , 28 ) ;
89+
6190const oldOpenAiCacheFile = path . join ( root , 'old-openai-cache.json' ) ;
6291await writeFile (
6392 oldOpenAiCacheFile ,
0 commit comments