Files
risuai/src/ts/model/openrouter.ts
2023-07-21 17:41:48 +09:00

11 lines
288 B
TypeScript

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 []
}
}