Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/app/api/providers/[id]/test/testUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}` },
Expand Down