Repository navigation
Description
Summary
When a model has no known price, its usage is charged at 0. Table output prints a stderr warning ("Missing pricing for X; cost excludes this model"), but --json output carries no signal at all: the row shows "totalCost": 0 and the model breakdown looks identical to a free model. Scripts, dashboards, and the statusline JSON cache cannot tell "free" from "unknown", and the number silently understates spend until the pricing snapshot catches up.
This is the recurring shape behind most pricing issues here (new model lands, users see $0 for days, nobody notices in JSON). The detection already exists: ModelBreakdown.missing_pricing is computed for every entry, but it is #[serde(skip_serializing)] and only the table path reads it.
Reproduce
Any transcript with a model absent from the pricing map. On my machine a pi session logged openrouter/auto-beta:
ccusage pi monthly # stderr: WARN Missing pricing for [pi] openrouter/auto-beta ...
ccusage pi monthly --json # no warning, no field, cost 0Reproduced on main ef300c9 and on the published 20.0.20.
Proposal
Additive JSON fields, present only when relevant, so existing consumers and the 14 snapshot files that contain totals do not change for priced reports:
totals.unpricedModels: sorted, deduplicated model names, key omitted when empty. Scripts use.totals.unpricedModels // [].modelBreakdowns[].missingPricing: true, omitted when false. Focusedcodexreports set the same flag on the affected entries of each period'smodelsmap.--no-costkeeps both, since they describe availability rather than amounts.- Detection follows the cost mode: display mode and auto mode with stored costs look nothing up and report nothing. Docs state that an absent key means "no unpriced usage detected under this mode", not "every price is current".
Covers daily, weekly, monthly, and session reports for every agent, including --instances, --sections, and --by-agent. Two paths have no totals object and are left for a follow-up if wanted: blocks and session --id.
Two design questions for you
- Placement. The list lives inside
totalsnext to the numeric aggregates. A consumer that iterates and sums everytotalsvalue would break only on a report with an unpriced model. Alternative: a top-levelunpricedModelsnext tototals, or apricingobject. I went withtotalsbecause that is where scripts already look, and omit-when-empty keeps priced reports byte-identical. Happy to move it. - Name.
unpricedModelsreads naturally with.totals;missingPricingModelswould match themissingPricingflag exactly. Your call.
I have this implemented with tests (core, unified, codex, cost-mode suppression, zero-rate vs unknown, --no-cost survival) and a docs section, and will open the PR right after triage.
Activity
pullfrog commentedon Sep 16, 2026
github-actions commentedon Sep 16, 2026
Pullfrog triage: priority:low
Kind: feature request
Maintenance fit: excluded
Confidence: high
Request adds new optional JSON fields to signal unknown pricing. Table warning and zero cost already exist, so this is a new output surface for scripts and dashboards, not a fix to existing priced behavior. No maintainer endorsement in history, so excluded with low priority.
Decision: closed by the contribution gate.
ryoppippi commentedon Sep 17, 2026
Reopening after maintainer review. The contribution gate misclassified this as a low-priority feature request.
Current
mainalready tracks missing pricing internally, butModelBreakdown.missing_pricingis explicitly excluded from serialization, totals JSON carries no equivalent signal, and the missing-pricing warning is emitted only by table renderers. JSON and jq consumers therefore cannot distinguish a genuinely zero-priced model from usage whose price was unavailable, so automated reports can silently understate spend.This is a bounded machine-readable reporting correctness issue, not a new source or a broad product feature. I have reclassified it as
bug,priority:medium, andtriage:maintainable.The exact JSON shape still needs API review; reopening does not pre-approve the proposed field names or implementation. A focused PR should preserve existing output when all models are priced and cover shared and focused reports, jq output,
--no-cost, and the distinction between an explicit zero price and missing pricing.