[feat] openrouter apis

This commit is contained in:
kwaroran
2023-07-21 17:41:48 +09:00
parent b0fa63a14b
commit 7d2860bf35
10 changed files with 51 additions and 18 deletions

View File

@@ -0,0 +1,11 @@
export async function openRouterModels() {
try {
const aim = fetch("https://openrouter.ai/api/v1/models")
const res = await (await aim).json()
return res.data.map((v:any) => {
return v.id
})
} catch (error) {
return []
}
}