9router / src /app /api /usage /history /route.js
2api
feat: configurable stream stall timeout + per-provider UI
88c4c60
Raw
History Blame Contribute Delete
380 Bytes
import { NextResponse } from "next/server";
import { getUsageStats } from "@/lib/usageDb";
export async function GET() {
try {
const stats = await getUsageStats();
return NextResponse.json(stats);
} catch (error) {
console.error("Error fetching usage stats:", error);
return NextResponse.json({ error: "Failed to fetch usage stats" }, { status: 500 });
}
}