# `gate.quota`: Quota tracking ```{py:currentmodule} gate.quota ``` Multi-harness quota tracking and economic estimation. Tracks quota windows (session, rolling, calendar), estimates USD list-price and physical energy (kWh) from token tallies, and renders compact text tables or JSON for CLI consumption. ## Status: library only, not wired to the CLI The data models, estimation, window, and rendering functions below are real and tested. The `gate quota` console command is not: it has no local-ledger harness feed wired up, so it always prints "quota tracking is not implemented" to stderr and exits 2 (plain or `--json`) rather than rendering the empty `QuotaSnapshot` this module's `main()` would otherwise produce -- a well-formed empty success would read as "no harness is near its cap," which is not something the CLI can honestly claim yet. `gate.dashboard`'s quota panel is downstream of the same unwired feed. This module is unrelated to `gate grant`/`gate revoke`/`gate grants`: those mint and spend short-lived, human-issued bypass grants for the superheavy-model hook ([One-off grants](configuration.md)), not usage quota. Both happen to carry an expiry, but a grant's TTL and a quota window are different mechanisms with no shared state. ## Data models ```{eval-rst} .. autoclass:: gate.quota.TokenTotals .. autoclass:: gate.quota.WindowSpec .. autoclass:: gate.quota.WindowState .. autoclass:: gate.quota.HarnessQuota .. autoclass:: gate.quota.QuotaSnapshot .. autoclass:: gate.quota.QuotaEvent ``` ## Economic estimation ```{eval-rst} .. autofunction:: gate.quota.estimate_usd .. autofunction:: gate.quota.estimate_kwh .. autofunction:: gate.quota.price_for_model ``` ## Window management ```{eval-rst} .. autofunction:: gate.quota.compute_window_state ``` ## Reconciliation ```{eval-rst} .. autofunction:: gate.quota.detect_reset .. autofunction:: gate.quota.detect_burst ``` ## Rendering ```{eval-rst} .. autofunction:: gate.quota.render_table .. autofunction:: gate.quota.render_json ```