How the routed-spend band works
This page explains the included routed-spend band on the Billing page, served by GET /platform/v1/billing/band.
What it is
Each paid plan includes a monthly amount of routed provider spend: Developer $2,500/mo, Team $7,500/mo, Growth $25,000/mo, Scale $75,000/mo. Spend past the included amount is counted in whole steps of $5,000, each priced at a flat $60. The step price is a fixed integer dollar amount, never a percentage of spend or savings. Today the band is a visibility number, and the step figure is a display artifact: no published plan charges it, crossing emits no charge, and no traffic is touched. overageBilled is always false.
How it is computed
All money is integer micro-USD, one millionth of a dollar. Whole-dollar catalog values convert by multiplying by 1,000,000.
- Terms. From the served plan catalog:
includedUsd,stepSizeUsd, and a step price. Free and Enterprise carry no band, so the payload answersactive: falsewith no usage keys. - Period. The UTC calendar month containing now, as
YYYY-MM. - Used. Workspace month-to-date spend:
SUM(spend_micro_usd)fromrollup_dailywhereday >= first of month AND day < first of next month. This is the same aggregate the dashboard total and workspace caps read. Per-request cost comes from the meter; see spend. - Step rate lock. The first read in a period inserts
(workspace, period, step_micro_usd)intoband_step_lockswithON CONFLICT DO NOTHING, then reads the stored value back. A catalog change mid-period does not move it. The next period locks the new rate. - Steps.
over = used - included. Ifover <= 0, steps is 0. Otherwisesteps = (over - 1) / step_size + 1, integer division. Ceiling, so entering a step counts it. - Overage.
steps * locked step price, integer, display only.usedandoveragerender in whole cents, half away from zero;usedMicroUsdandoverageMicroUsdare the integers.
Worked example. Team, one UTC month, $12,000.00 routed.
| Term | Micro-USD |
|---|---|
| used | 12,000,000,000 |
| included | 7,500,000,000 |
| over | 4,500,000,000 |
| step size | 5,000,000,000 |
| step price | 60,000,000 |
(4,500,000,000 - 1) / 5,000,000,000 = 0, plus 1, is 1 step. Overage is 1 x 60,000,000 = 60,000,000, shown as $60.00 on the band tile and charged nowhere. Two edge checks: 7,500,000,000 used is 0 steps, and 7,500,000,001 used is 1 step.
The underlying rows chain under recovea-chain-v1, the only recipe production writes.
What it does not include
- Traffic that did not pass through our gateway.
- Requests refused before a provider call. There is no usage to price.
- Requests we could not price. They add zero, which understates the position.
- Provider discounts, credits, committed-use terms, and taxes. The band measures list price.
- Your Recovea subscription fee, which is not routed spend.
- Any per-key or per-project view. The band is one workspace total.
- Savings of any kind. This number is spend.
Limits and current status
- Enforcement. Not shipped, by construction. No code path attaches band overage to an invoice, and no metered price is attached in Stripe. Any future enablement carries 30 days of notice, applies prospectively from renewal, and cannot be retroactive.
- Two implementations, one served.
crates/billing/src/band.rsholds the crossing event, the enforcement-notice descriptor, and theRetroactivity::Nevertype, and is not on the served path. The endpoint reimplements the same ceiling arithmetic incrates/platform/src/billing.rs. Both are tested and agree, but no crossing event is emitted anywhere today, so there is no crossing notification or email. - Period alignment. The band window is the UTC calendar month. The stored subscription period end is not used here, so on an annual or mid-month subscription the band window and the invoice window differ.
- Budgets. Only workspace-scoped caps reach the gateway. Key- and project-scoped caps store but are not enforced yet.
- Alerts. The sweep runs about once a minute, so a fast burst can reach a cap between checks. Alerts warn on the way up. They are not an ordering guarantee.
- Counterfactual. Measured, never applied. Levers are not activated in any deployed environment, so none has changed a request or the band position.
- CPSO. Served at list price. Invoice reconciliation at period close is planned, not wired.
- Score. The engine is not shipped. No workspace has a score today.
- Spend and attribution drift. The band reads
rollup_daily, the by-model cut and CPSO readreceipts, attribution cuts readrollup_cuts. Same events, three layers, and no job continuously proves they agree. Receipt and rollup are separate writes, so a rollup failure after a receipt lands leaves that spend out of the band while the receipt stands. Receipts are the record of truth. Separately, two plan catalogs exist in the tree with differentworkingNumbersdefaults; the band payload serves the platform one, where the flag isfalse.
Where to check us
- Export the period:
GET /platform/v1/ledger/export?period=YYYY-MM&format=jsonl. Rows carrycostMicroUsd,priceListVersion,previousHash, androwHash. The key-authedGET /v1/ledger/exportserves the same rows in snake_case —price_list_version,previous_hash,row_hash— with the integer micro-USD undercostin JSONL and JSON and under thecost_micro_usdcolumn in CSV. - Sum
costMicroUsdacross the export and compare withusedMicroUsdfrom the band payload for the same month. They should agree to the micro-USD. If they do not, a rollup write is missing; send us the request ids. - Re-derive the steps from
usedMicroUsd,includedUsd,stepSizeUsd, andstepMicroUsdin that same payload, using the integer arithmetic above. - Check the billing claim directly:
overageBilledisfalse, andGET /platform/v1/billing/invoicescarries no overage line for any period.