SPB Git

spb/chat-spboucher Public

Private universal chat interface over the OpenRouter ecosystem — 400+ models, branching, streaming, usage tracking. Next.js 16 + SQLite, PWA, deployed on m4m64a at chat.spboucher.ai

TypeScript 78.8% CSS 15.1% JavaScript 4.9% Shell 1.2%
731 B · 24 lines typescript
Raw Blame History
1// Author: Simon-Pierre Boucher2// Contact: contact@spboucher.ai3// Project: chat.spboucher.ai45import { NextResponse } from "next/server";6import { requireSession } from "@/lib/auth/guard";7import { ensureCatalogFresh, listCatalog, catalogSyncedAt } from "@/lib/catalog";89export const runtime = "nodejs";1011export async function GET() {12  const { unauthorized } = await requireSession();13  if (unauthorized) return unauthorized;14  try {15    await ensureCatalogFresh();16  } catch {17    return NextResponse.json(18      { error: "Could not load the model catalog from OpenRouter. Check connectivity and retry." },19      { status: 502 }20    );21  }22  return NextResponse.json({ models: listCatalog(), syncedAt: catalogSyncedAt() });23}24