Skip to content

Releases

spend-meter 0.1.0

Choose a tag to compare

@makriman makriman released this 15 Nov 09:35
e5b09d1

Added

  • Pre-spend filter spend_meter_pre_spend and spend_meter_check(): global and purpose kill switches, intent validation, price lookup and estimate, reserve-then-sum caps (site, purpose, network; day and month), decision filter that can only deny. Contract version SPEND_METER_API 1.
  • Record action spend_meter_record and spend_meter_record(): one row per attempt, settle in place, linked retries, unreserved records, idempotent call_id, cost source precedence, account errors, fallback model, shutdown retry buffer.
  • Release action spend_meter_release, reservation lifetime with an hourly expiry task.
  • spend_meter_usage_from_response() for both common usage shapes, with cached and reasoning tokens as subsets.
  • Unpriced models denied by default (unpriced_model); the allow_unpriced setting lets them through, flagged and logged.
  • Price table: shipped format with no prices, operator overrides, import and export with dry-run diff, prefix rows, price_version, staleness, reprice for unpriced rows.
  • Cap alerts spend_meter_cap_warning and spend_meter_cap_reached, once per scope per window.
  • Dashboard widget, network widget, settings screen, admin notices.
  • WP-CLI wp spend-meter: status, report, check, caps, kill, prices, reprice, reservations, export, prune.
  • Retention, uninstall with an option to keep the ledger, must-use loader.

Install: composer require indianopinion/spend-meter