Home

boring / v2

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

fix(economics): OpenRouter split by api_key_id (key name), not key hash

3 months ago

0358a98
Authored
grim7/23/2026, 2:49:55 AM
The analytics/query 400 came from filtering on api_key_hash, which is not a valid
field. The meta endpoint shows the API-key dimension is api_key_id, whose value is
the key NAME. Switch to one grouped query (dimensions:[api_key_id]) and match
prod/eval by name via OPENROUTER_PROD_KEY_NAME / OPENROUTER_EVAL_KEY_NAME. Without
names, take the account aggregate as prod-key. Verified live: pull returns ok.

Parent3d811e5

3 files changed
  • .env.example+4−2
  • apps/worker/src/jobs/pull-provider-costs.test.ts+50−3
  • apps/worker/src/jobs/pull-provider-costs.ts+93−53