Skip to content

v0.31.0 — Usage accounting v2

Choose a tag to compare

@ayleen ayleen released this 09 Aug 11:00

Highlights

  • Added canonical usage accounting v2 with separate uncached input, cache-read,
    cache-write, visible-output, reasoning, combined, and reported/derived total
    fields.
  • Preserved the native usage detail reported by DeepSeek, Z.AI, Kimi, generic
    OpenAI-compatible APIs, OpenCode, and Crush instead of collapsing it into the
    legacy three-counter shape.
  • Made unknown distinct from zero across JSONL persistence, aggregation, CLI,
    coder envelopes, MCP responses, and cost calculation.
  • Added fail-closed counter/provenance validation and complete-vs-evidence cost
    semantics, while retaining v1 compatibility for one transition release.
  • Re-verified and updated current Kimi K3, K2.7 Code, K2.7 Code HighSpeed, and
    K2.6 PAYG/cache-hit prices.
  • Fixed triss_write so usage reports can no longer be copied into generated
    files or truncate model output that resembles a display marker.
  • Increased the default active usage-log rotation threshold from 10 MiB to
    40 MiB to preserve a comparable reporting horizon for larger v2 records.

See the changelog and the usage accounting contract for complete details.

Release verification: Node 22/24 CI, consumer package smoke, CodeQL, full
publish tests, npm audit with zero vulnerabilities, and npm provenance publish
all passed on the release lineage.