MCPcopy Create free account
hub / github.com/AICoderTudou/claude-code-tudou / listOpenRouterModels

Function listOpenRouterModels

desktop/main.cjs:227–237  ·  view source on GitHub ↗
(timeoutMs)

Source from the content-addressed store, hash-verified

225}
226
227async function listOpenRouterModels(timeoutMs) {
228 const result = await fetchJsonWithTimeout("https://openrouter.ai/api/v1/models", { timeoutMs });
229 if (!result.ok) {
230 return {
231 ok: false,
232 error: `OpenRouter models API failed (${result.status})`,
233 };
234 }
235 const models = normalizeModelEntries(result?.data?.data, "openrouter");
236 return { ok: true, models };
237}
238
239async function listAnthropicModels(apiKey, timeoutMs) {
240 if (!apiKey || !apiKey.trim()) {

Callers 1

main.cjsFile · 0.85

Calls 2

fetchJsonWithTimeoutFunction · 0.85
normalizeModelEntriesFunction · 0.85

Tested by

no test coverage detected