Phase 5: Refresh Cost Accounting — Fix Pricing Defaults and Unpriced Model Handling #40

Closed
opened 2026-05-21 00:49:48 -05:00 by null · 0 comments
Owner

References: remaining-usage-accuracy-review-plan.md — Phase 5

Summary

Pipeline's pricing defaults differ from the reference dashboard for cache pricing (especially Anthropic Opus cache write/read). Some models like openai/gpt-4.1-mini are missing. The pricing override loader expects a direct dict rather than the reference dashboard's rates_usd_per_million shape. This causes cost underreporting or silent /usr/bin/zsh for known paid models.

Acceptance Criteria

  • Reference dashboard pricing fixtures produce matching cost outputs in Pipeline
  • Unknown paid models show unpriced=True rather than silently reporting zero
  • Explicit usage.cost.total always wins over local pricing estimates

Work

  1. Support both pricing override shapes: direct { "provider/model": { ... } } and dashboard-style { "rates_usd_per_million": { ... } }
  2. Update default pricing for current Claude/OpenAI/Codex models (especially cache read/write)
  3. Keep explicit usage.cost.total as the preferred cost source
  4. Add tests for cache read/write cost, unknown paid models, and override-file shape

Do Not

  • Do not silently report /usr/bin/zsh for unknown paid models
  • Do not treat local estimates as billing-grade invoices
  • Do not overwrite explicit runtime/provider cost with local pricing
  • Do not mix provider-native subscription percent into cost calculations

Priority: Medium
Phase: 5

References: [`remaining-usage-accuracy-review-plan.md`](docs/remaining-usage-accuracy-review-plan.md) — Phase 5 ## Summary Pipeline's pricing defaults differ from the reference dashboard for cache pricing (especially Anthropic Opus cache write/read). Some models like `openai/gpt-4.1-mini` are missing. The pricing override loader expects a direct dict rather than the reference dashboard's `rates_usd_per_million` shape. This causes cost underreporting or silent `/usr/bin/zsh` for known paid models. ## Acceptance Criteria - Reference dashboard pricing fixtures produce matching cost outputs in Pipeline - Unknown paid models show `unpriced=True` rather than silently reporting zero - Explicit `usage.cost.total` always wins over local pricing estimates ## Work 1. Support both pricing override shapes: direct `{ "provider/model": { ... } }` and dashboard-style `{ "rates_usd_per_million": { ... } }` 2. Update default pricing for current Claude/OpenAI/Codex models (especially cache read/write) 3. Keep explicit `usage.cost.total` as the preferred cost source 4. Add tests for cache read/write cost, unknown paid models, and override-file shape ## Do Not - Do not silently report `/usr/bin/zsh` for unknown paid models - Do not treat local estimates as billing-grade invoices - Do not overwrite explicit runtime/provider cost with local pricing - Do not mix provider-native subscription percent into cost calculations **Priority:** Medium **Phase:** 5
null added the
backend
cost-accounting
phase:5
priority:medium
service
labels 2026-05-21 00:53:41 -05:00
null closed this issue 2026-05-21 01:49:54 -05:00
Sign in to join this conversation.
No description provided.