The cost code path already exists (cortex list_models populates
cost: profile.cost from the catalogue; aliases inherit it), so opencode's
$0.00 is a config gap (no cost in the live models.toml), not missing
plumbing. What was missing is the *contract*: units pinned against a wire
test, and a defined meaning for "free".
- Document ModelCost as the load-bearing source of truth: USD per 1,000,000
tokens as JSON numbers (models.dev/opencode shape) — NOT per-token, NOT
decimal strings (OpenRouter's pricing shape, which helexa deliberately
does not emit). Define the absent-vs-zero distinction: cost omitted = "not
priced / unknown"; cost present with 0.0 = "intentionally free". Note the
advertised rate must equal what metering (#51) / reconciliation (#58/#59)
bill against — today both read this catalogue value.
- New wire test (model_cost.rs): a priced model with cache tiers flows
through as per-million numbers; an explicit-0.0 free model keeps its cost
block with cache tiers omitted; an unpriced model omits `cost` entirely.
- models.example.toml: document cost.* in the field reference and show all
three cases (priced-free explicit 0.0 vs the unpriced Qwen3-8B with no
cost block).
Decisions recorded on #68: source of truth = operator models.toml for now
(marketplace clearing house #59 later, same value); no OpenRouter-style
`pricing` (opencode/models.dev alignment is sufficient); end-to-end
non-zero $ spent needs operators to populate cost in the live catalogue.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M5aNfNzS2fSZ5wnMeSQ9Wg