Skip to main content
PUT
Set the budget

Authorizations

oc_session
string
cookie
required

The console's session cookie (httpOnly, SameSite=Lax, 30 days), set by signup and login.

Body

application/json
limitUsd
number | null
required

Dollars per month, or null for no budget.

Required range: 0 <= x <= 1000000
enforce
boolean
required

Response

The billing object.

mode
enum<string>
required

test: the built-in test checkout or a Stripe test key. live: a live Stripe key. off: card payments are not open yet, so every team runs on its free credit.

Available options:
test,
live,
off
plan
object
required
card
object | null
required

Null until a card is added.

credit
object
required

Credit is what a team spends before its card is charged. It comes as grants: the sign-up credit, and any offstage gives (the YC deal), each with its own expiry or none. The sums count the grants still active. Work draws on the grants that were active when it was admitted, the soonest to expire first.

period
object
required
budget
object
required
ceiling
object
required

The credit ceiling: the most a card on file is trusted with at once beyond the free credit, set by offstage ($100 unless offstage set this team's own). While a card is on file, work that could pass it is refused with 402 credit-ceiling, whatever the budget says; the budget can only refuse sooner. Without a card the free credit is the limit.

status
enum<string>
required

past_due: the last charge failed and new work is refused with 402 payment-failed until the card is fixed.

Available options:
active,
past_due
portal
boolean
required

Whether openBillingPortal works (false in test mode).

postpaid
boolean
required

Legacy month-end invoicing: usage beyond the credit is invoiced on the 1st, under the credit ceiling. False for every team made since prepaid credit, and for good once a postpaid team buys credit or turns auto-reload on.

autoReload
object
required

Auto-reload: when the balance (credit left, less what work in flight holds) falls below thresholdUsd, the card on file is charged for what brings it back to targetUsd.

failureMessage
string

Present when past_due: why the charge failed.