diff --git a/src/app/api/providers/[id]/test/testUtils.js b/src/app/api/providers/[id]/test/testUtils.js index b9bd966a862..4dd04e6a4f9 100644 --- a/src/app/api/providers/[id]/test/testUtils.js +++ b/src/app/api/providers/[id]/test/testUtils.js @@ -788,7 +788,14 @@ async function testApiKeyConnection(connection, effectiveProxy = null) { ); return { valid: exRes.ok, error: exRes.ok ? null : "Invalid Personal Access Token" }; } -case "llm7": { + case "tokenrouter": { + const baseUrl = connection.providerSpecificData?.baseUrl || "https://api.tokenrouter.com/v1"; + const res = await fetchWithConnectionProxy(`${baseUrl.replace(/\/$/, "")}/models`, { + headers: { Authorization: `Bearer ${connection.apiKey}` }, + }, effectiveProxy); + return { valid: res.ok, error: res.ok ? null : "Invalid API key or base URL" }; + } + case "llm7": { const baseUrl = connection.providerSpecificData?.baseUrl || "https://api.llm7.io/v1"; const res = await fetchWithConnectionProxy(`${baseUrl.replace(/\/$/, "")}/models`, { headers: { Authorization: `Bearer ${connection.apiKey}` },