@@ -4,7 +4,12 @@ import * as path from "path"
44
55import { back as nockBack } from "nock"
66
7- import { PROMPT_CACHING_MODELS } from "../../../../shared/api"
7+ import {
8+ OPEN_ROUTER_PROMPT_CACHING_MODELS ,
9+ OPEN_ROUTER_COMPUTER_USE_MODELS ,
10+ OPEN_ROUTER_REASONING_BUDGET_MODELS ,
11+ OPEN_ROUTER_REQUIRED_REASONING_BUDGET_MODELS ,
12+ } from "../../../../shared/api"
813
914import { getOpenRouterModelEndpoints , getOpenRouterModels } from "../openrouter"
1015
@@ -23,22 +28,14 @@ describe("OpenRouter API", () => {
2328 . filter ( ( [ _ , model ] ) => model . supportsPromptCache )
2429 . map ( ( [ id , _ ] ) => id )
2530 . sort ( ) ,
26- ) . toEqual ( Array . from ( PROMPT_CACHING_MODELS ) . sort ( ) )
31+ ) . toEqual ( Array . from ( OPEN_ROUTER_PROMPT_CACHING_MODELS ) . sort ( ) )
2732
2833 expect (
2934 Object . entries ( models )
3035 . filter ( ( [ _ , model ] ) => model . supportsComputerUse )
3136 . map ( ( [ id , _ ] ) => id )
3237 . sort ( ) ,
33- ) . toEqual ( [
34- "anthropic/claude-3.5-sonnet" ,
35- "anthropic/claude-3.5-sonnet:beta" ,
36- "anthropic/claude-3.7-sonnet" ,
37- "anthropic/claude-3.7-sonnet:beta" ,
38- "anthropic/claude-3.7-sonnet:thinking" ,
39- "anthropic/claude-opus-4" ,
40- "anthropic/claude-sonnet-4" ,
41- ] )
38+ ) . toEqual ( Array . from ( OPEN_ROUTER_COMPUTER_USE_MODELS ) . sort ( ) )
4239
4340 expect (
4441 Object . entries ( models )
@@ -108,19 +105,14 @@ describe("OpenRouter API", () => {
108105 . filter ( ( [ _ , model ] ) => model . supportsReasoningBudget )
109106 . map ( ( [ id , _ ] ) => id )
110107 . sort ( ) ,
111- ) . toEqual ( [
112- "anthropic/claude-3.7-sonnet:beta" ,
113- "anthropic/claude-3.7-sonnet:thinking" ,
114- "anthropic/claude-opus-4" ,
115- "anthropic/claude-sonnet-4" ,
116- ] )
108+ ) . toEqual ( Array . from ( OPEN_ROUTER_REASONING_BUDGET_MODELS ) . sort ( ) )
117109
118110 expect (
119111 Object . entries ( models )
120112 . filter ( ( [ _ , model ] ) => model . requiredReasoningBudget )
121113 . map ( ( [ id , _ ] ) => id )
122114 . sort ( ) ,
123- ) . toEqual ( [ "anthropic/claude-3.7-sonnet:thinking" ] )
115+ ) . toEqual ( Array . from ( OPEN_ROUTER_REQUIRED_REASONING_BUDGET_MODELS ) . sort ( ) )
124116
125117 expect ( models [ "anthropic/claude-3.7-sonnet" ] ) . toEqual ( {
126118 maxTokens : 8192 ,
@@ -155,6 +147,8 @@ describe("OpenRouter API", () => {
155147 supportedParameters : [ "max_tokens" , "temperature" , "reasoning" , "include_reasoning" ] ,
156148 } )
157149
150+ expect ( models [ "google/gemini-2.5-flash-preview-05-20" ] . maxTokens ) . toEqual ( 65535 )
151+
158152 const anthropicModels = Object . entries ( models )
159153 . filter ( ( [ id , _ ] ) => id . startsWith ( "anthropic/claude-3" ) )
160154 . map ( ( [ id , model ] ) => ( { id, maxTokens : model . maxTokens } ) )
@@ -200,7 +194,6 @@ describe("OpenRouter API", () => {
200194 cacheWritesPrice : 1.625 ,
201195 cacheReadsPrice : 0.31 ,
202196 description : undefined ,
203- supportsReasoningBudget : false ,
204197 supportsReasoningEffort : undefined ,
205198 supportedParameters : undefined ,
206199 } ,
@@ -214,7 +207,6 @@ describe("OpenRouter API", () => {
214207 cacheWritesPrice : 1.625 ,
215208 cacheReadsPrice : 0.31 ,
216209 description : undefined ,
217- supportsReasoningBudget : false ,
218210 supportsReasoningEffort : undefined ,
219211 supportedParameters : undefined ,
220212 } ,
0 commit comments