/ai/models route

This commit is contained in:
2026-01-31 14:16:12 +00:00
parent 8196fb0bf6
commit 95beddaa6c
7 changed files with 45 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
import type { AuthedRequest } from "../../auth/middleware";
import { getCachedFreeModels } from "./opencode";
// GET /ai/models - returns cached free models
export default function aiModels(_req: AuthedRequest) {
const models = getCachedFreeModels();
return Response.json(models);
}

View File

@@ -1,4 +1,5 @@
import aiChat from "./ai/chat";
import aiModels from "./ai/models";
import authLogin from "./auth/login";
import authLogout from "./auth/logout";
import authMe from "./auth/me";
@@ -58,6 +59,7 @@ import userUploadAvatar from "./user/upload-avatar";
export const routes = {
aiChat,
aiModels,
authRegister,
authLogin,