File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ export const modelInfoSchema = z.object({
8282 minTokensPerCachePoint : z . number ( ) . optional ( ) ,
8383 maxCachePoints : z . number ( ) . optional ( ) ,
8484 cachableFields : z . array ( z . string ( ) ) . optional ( ) ,
85- // ...existing code...
8685} )
8786
8887export type ModelInfo = z . infer < typeof modelInfoSchema >
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export const openAiNativeModels = {
3434 name : "flex" ,
3535 inputPrice : 0.625 ,
3636 outputPrice : 5.0 ,
37- cacheReadsPrice : 0.063 ,
37+ cacheReadsPrice : 0.0625 ,
3838 } ,
3939 ] ,
4040 description : "GPT-5: The best model for coding and agentic tasks across domains" ,
@@ -55,9 +55,10 @@ export const openAiNativeModels = {
5555 tiers : [
5656 {
5757 name : "flex" ,
58+ contextWindow : 400000 ,
5859 inputPrice : 0.125 ,
5960 outputPrice : 1.0 ,
60- cacheReadsPrice : 0.013 ,
61+ cacheReadsPrice : 0.0125 ,
6162 } ,
6263 ] ,
6364 description : "GPT-5 Mini: A faster, more cost-efficient version of GPT-5 for well-defined tasks" ,
@@ -77,9 +78,10 @@ export const openAiNativeModels = {
7778 tiers : [
7879 {
7980 name : "flex" ,
81+ contextWindow : 400000 ,
8082 inputPrice : 0.025 ,
8183 outputPrice : 0.2 ,
82- cacheReadsPrice : 0.003 ,
84+ cacheReadsPrice : 0.0025 ,
8385 } ,
8486 ] ,
8587 description : "GPT-5 Nano: Fastest, most cost-efficient version of GPT-5" ,
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
250250 if ( tier ) {
251251 info = {
252252 ...info ,
253- contextWindow : tier . contextWindow ,
253+ contextWindow : tier . contextWindow ?? info . contextWindow ,
254254 inputPrice : tier . inputPrice ,
255255 outputPrice : tier . outputPrice ,
256256 cacheWritesPrice : tier . cacheWritesPrice ,
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
287287 // If there's tiered pricing then adjust the input and output token prices
288288 // based on the input tokens used.
289289 if ( info . tiers ) {
290- const tier = info . tiers . find ( ( tier ) => inputTokens <= tier . contextWindow )
290+ const tier = info . tiers . find ( ( tier ) => tier . contextWindow && inputTokens <= tier . contextWindow )
291291
292292 if ( tier ) {
293293 inputPrice = tier . inputPrice ?? inputPrice
You can’t perform that action at this time.
0 commit comments