Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

feat(economics): pull-provider-costs cron (slice 4)

3 months ago

2da6eda
Authored
grim7/23/2026, 12:50:13 AM
Daily 01:40 UTC pull of OpenRouter analytics (per-key when hashes configured),
Railway MTD estimated usage, and PlanetScale accrual into provider_costs_daily.
Each provider is credential-gated and independently guarded, so a missing token
or a failing pull skips that provider and never blocks the rest. PlanetScale
always writes its interpolated flat accrual (estimated). Parse helpers and
orchestration are unit-tested with injected fetch, no network. Env var names
documented in .env.example.

Parent33e99d1

4 files changed
  • .env.example+22−0
  • apps/worker/src/index.ts+9−0
  • apps/worker/src/jobs/pull-provider-costs.test.ts+148−0
  • apps/worker/src/jobs/pull-provider-costs.ts+308−0