View billing status
GET /v1/billing returns the current plan, credit usage, and every plan you could switch
to.
credits_reset_at is when the credit allowance refreshes: on a paid plan, the end of the
Stripe billing period, so it falls on the day of the month you subscribed; on Free, the
signup anniversary. It is not the 1st of the calendar month. A date landing in a month
too short for it (the 31st, in February) moves to the last day of that month.
current_month_ops and the line_items counts are still measured over the calendar
month to date, which is a different window from the credit period whenever your billing
date is not the 1st. credits_used is the figure that matches credits_reset_at.line_items is credit-cost accounting, not a Stripe invoice. The amount you are actually
billed comes from Stripe.Change plan
Free tiers
400 payment_required and
directs you to /v1/billing/checkout instead.
Paid plans
checkout_url. Stripe’s webhook flips the organization onto the
new plan and syncs its quota once payment completes, so polling /v1/billing right
after the redirect may still show the old plan for a few seconds.
Manage an existing subscription
POST /v1/billing/portal requires an existing Stripe customer, meaning you have
completed checkout at least once.
GET /v1/billing keeps reporting the
larger plan until the change lands.
Cancel
credits_reset_at. The organization keeps its paid plan and credits until then.
Error responses
See the full error reference.
