Skip to content

Surface Pro active series and Stripe price tiers in usage#919

Draft
epompeii wants to merge 1 commit into
active-series-billingfrom
claude/pro-active-series-usage
Draft

Surface Pro active series and Stripe price tiers in usage#919
epompeii wants to merge 1 commit into
active-series-billingfrom
claude/pro-active-series-usage

Conversation

@epompeii

Copy link
Copy Markdown
Member

Stacked on #918.

What

Two follow-ups to #918 (Pro plans billed on active time-series):

  1. /usage surfaces the Pro active-series count. Previously /usage returned an informational metrics figure for Pro that no longer matched the bill. It now returns active_series (via the existing series::count_active), the actual Pro billable figure.

  2. The Pro price ladder is read from Stripe, not hardcoded in the Console. JsonPlan now carries the Stripe tiered price (tiers), read from the price the subscription is billed on. The billing panel renders the current band, the full ladder, and the base fee from usage.plan.tiers / usage.plan.unit_amount, so what we display cannot drift from what we bill.

The Console moves Pro from the old "$20 + $20 credit, $0.01/result" model to the series-band model:

Active series Price
0-250 $100 / month
251-375 $150 / month
376-500 $200 / month
501+ Get in Touch

Bare Metal runner minutes bill separately on top of the band fee, except during the first-month free trial (base waived plus runner minutes included = $0).

Changes

  • bencher_json: JsonPriceTier (up_to / unit_amount / flat_amount, the two amounts additive), JsonPlan.tiers, JsonUsage.active_series.
  • bencher_billing: Products::price_tiers maps the Stripe price's full tier ladder to JSON; get_plan attaches it.
  • api_organizations: metered_plan_usage returns active series for Pro (Team/Enterprise still on metrics); the Cloud branch is extracted into cloud_plan_usage.
  • Console: convert.ts tier helpers (currentSeriesTier, seriesTierRange, fmtTierPrice, tierEstimateUsd, ...) over JsonPlan.tiers; a new ProMeteredPanel; InnerPricingTable and the pricing.astro FAQ rewritten to the series-band model.
  • Regenerated openapi.json and bencher.ts.

Tests

  • bencher_billing: to_json_tier mapping (flat-only, per-series-only, both, and the unbounded contact tier).
  • convert.test.ts: tier helpers across all four price shapes plus the contact tier.
  • Existing api_organizations usage endpoint tests and bencher_json billing config tests still pass.
  • Pro active-series counting is covered by series::count_active (oracle tests) and metered_bills_active_series.

Notes

  • The live Pro metered path needs Stripe, so it is not exercised by the integration TestServer (which covers the free and self-hosted paths).
  • The static public /pricing page keeps "$100 / 250 series" as marketing copy, since it has no subscription context to read tiers from; fully de-hardcoding it would need a public pricing-catalog endpoint (follow-up).

The /usage endpoint now reports the Pro active-series count (the Pro billable
figure) instead of an informational metrics figure, and JsonPlan carries the
Stripe tiered price ladder so the Console renders prices from the billed source
of truth rather than hardcoding them.

* bencher_json: add JsonPriceTier and JsonPlan.tiers; add JsonUsage.active_series
* bencher_billing: read the full tier ladder from the Stripe price
  (Products::price_tiers) and attach it in get_plan
* api_organizations: count active series for Pro via series::count_active
* Console: billing panel renders the current band, runner line, and full ladder
  from usage.plan.tiers; pricing table and FAQ move to the series-band model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant