feat: add GET /v1/usage/me endpoint for user-facing usage stats
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 12m41s

This commit is contained in:
OpenClaw 2026-03-07 08:04:34 +01:00
parent 2b4fa0c690
commit dd337d30b5
4 changed files with 145 additions and 2 deletions

View file

@ -91,4 +91,5 @@ vi.mock("../middleware/usage.js", () => ({
usageMiddleware: vi.fn((_req: any, _res: any, next: any) => next()),
loadUsageData: vi.fn().mockResolvedValue(undefined),
getUsageStats: vi.fn().mockReturnValue({ totalRequests: 0, keys: {} }),
getUsageForKey: vi.fn().mockReturnValue({ count: 0, monthKey: "2026-01" }),
}));