feat(public-api): T36-T38 implement public API endpoints

- GET /api/v1/stats: aggregated stats with date range (default 30 days)
- GET /api/v1/usage: paginated usage with required date filters
- GET /api/v1/keys: key list with stats, no key values exposed
- All endpoints use API token auth and rate limiting
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 16:15:49 +02:00
parent 3253293dd4
commit 88b43afa7e
2 changed files with 299 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ from fastapi.middleware.cors import CORSMiddleware
from openrouter_monitor.config import get_settings
from openrouter_monitor.routers import api_keys
from openrouter_monitor.routers import auth
from openrouter_monitor.routers import public_api
from openrouter_monitor.routers import stats
settings = get_settings()
@@ -33,6 +34,7 @@ app.add_middleware(
app.include_router(auth.router, prefix="/api/auth", tags=["authentication"])
app.include_router(api_keys.router, prefix="/api/keys", tags=["api-keys"])
app.include_router(stats.router)
app.include_router(public_api.router)
@app.get("/")