Files
2e897c5bfc fix Cat Credits metering and refresh AI model registry (#395)
* fix(cat): meter Cat Credits from OpenRouter's real usage.cost

Prefer OpenRouter's provider-reported per-request cost (usage.cost, USD→BTC)
for Cat Credits debits, falling back to the registry token-price estimate when
the field is absent. Ledger metadata now records pricingSource
(provider_reported | registry_estimate). Free models always meter to 0.

Pinned by regression tests for the metering preference and the OpenRouter cost
plumbing (buffered + streamed), guarding the prior "$0 for unknown model" leak.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(ai): refresh 2026 model roster and consolidate registry SSOT

Update AI_MODEL_REGISTRY to the Q1-2026-verified roster and pricing (free,
economy, standard, premium tiers), with boundary-safe resolution of
provider-returned snapshot ids. model-registry.ts is now a generated projection
of ai-models.ts rather than a drifted duplicate list.

Refresh docs to match reality: rewrite MODEL_SYSTEM.md (provider chain,
Cat Credits metering, current roster) and chat.md (authenticated /api/cat/chat
contract), retiring references to the removed UnifiedAIClient/ModelStatusBadge
and public /api/chat endpoint. Mark completed items in the research handoff.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 22:02:03 +02:00
..