[feat] openrouter apis
This commit is contained in:
11
src/ts/model/openrouter.ts
Normal file
11
src/ts/model/openrouter.ts
Normal 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 []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user