Commit Graph

11 Commits

Author SHA1 Message Date
leubeem
0b7345ced7 feat(server): per-user AI usage tracking, cost alerting, and endpoint hardening
Usage tracking:
- new UsageEvent collection records every STT/TTS/LLM call per user with
  provider, model, volume (audio seconds, characters, tokens) and an
  estimated USD cost; self-hosted providers (Speaches/Piper) and cache
  hits record at $0
- pricing table for whisper-1, tts-1, gpt-5-nano & co. in server/utils/usage.ts
- weekly KPI mail gains an "AI-Nutzung & Kosten" section: weekly and
  rolling 30-day cost, per-kind breakdown, top 5 users by cost
- quota alert mail when rolling 30-day cost exceeds USAGE_ALERT_USD
  (default $5), at most once per calendar month (UsageAlertDelivery)

Hardening:
- /api/atc/say now requires an authenticated session (middleware
  exemption removed); useFlightLabAudio sends the bearer token
- /api/service/tools/latency requires auth (was a public LLM endpoint)
- per-user rate limits: PTT 20/min, say 60/min, latency 5/min
- cron endpoints (waitlist-drip, weekly-kpi-report) require a shared
  secret via ?secret= or x-cron-secret (CRON_SECRET, falls back to
  KPI_CRON_SECRET); allowed with a warning while unset so existing
  deployments keep working
- PTT records the actual transcribed audio duration for billing accuracy

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 23:17:03 +02:00
itsrubberduck
d309b712f1 Wochenreport 2026-05-06 17:38:36 +02:00
Remi
317151dfa7 Brighten high-readability profiles and default to level 5 2025-10-18 21:39:23 +02:00
itsrubberduck
651a41106f merge 2025-10-12 15:42:18 +02:00
Remi
b756bf2ea6 Point bridge download to GitHub 2025-09-24 00:01:00 +02:00
Remi
3c12f6d836 feat: allow manual unlocks in learn missions 2025-09-22 07:40:15 +02:00
Remi
fbec5c4830 Add session timeline logging and admin sessions view 2025-09-21 23:08:10 +02:00
itsrubberduck
a477f9ccbb Fix duplicate schema index warning 2025-09-20 12:01:12 +02:00
Remi
a667bd3d3a Translate learn page and add audio speed control 2025-09-18 23:57:39 +02:00
Remi
6dbfe07d2b Persist learn progress per user 2025-09-18 23:30:55 +02:00
Remi
19f253f53e Implement authentication, waitlist, and logging upgrades 2025-09-16 17:28:34 +02:00