Auto-recharge
View MarkdownAuto-recharge buys credits for you when your available balance falls below a threshold you choose. Each recharge is charged to a saved card and emailed to you as a receipt, exactly like a top-up you buy yourself. It is off until you turn it on.
Turn it on
Section titled “Turn it on”nodus billing auto-recharge --threshold 10 --amount 50This recharges $50 whenever your available balance drops below $10. If no card is on file yet, the command first
opens a Stripe page to save one, then turns auto-recharge on. You can also save a card while buying credits with
nodus billing top-up 20 --save-card, and the console billing page has an auto-recharge card that does both.
The same settings live on your org’s BillingAccount:
apiVersion: nodus.dev/v1kind: BillingAccountmetadata: name: defaultspec: autoRecharge: enabled: true thresholdUSD: "10.00" # at least 5.00 amountUSD: "50.00" # 5.00 to 1000.00| Setting | Default | Allowed |
|---|---|---|
thresholdUSD |
"10.00" |
$5.00 or more |
amountUSD |
"20.00" |
$5.00 to $1,000.00 |
Turning it on without a saved card is refused; check PaymentMethodPresent in nodus billing, or save a card
through the billing portal (nodus billing portal).
When it recharges
Section titled “When it recharges”Nodus checks your balance each time it renews the hold of running work, settles inference or storage, or refuses a new hold. It recharges when all of these are true:
- your available balance is below
thresholdUSD; - a card is on file;
- no other auto-recharge is still being paid;
- the org has had fewer than 5 auto-recharges, and less than $5,000 of them, today (UTC);
- the last 3 auto-recharges did not all fail.
A recharge usually lands in seconds. Work whose funding is running short keeps running while it is paid, so a successful recharge within that window means nothing stops.
See what it did
Section titled “See what it did”Each recharge is a TopUp with spec.origin: AutoRecharge:
nodus get topups -o widenodus billing receiptsnodus billing shows the auto-recharge state from status.autoRecharge: consecutiveFailures,
lastAttemptTime, lastResult and, when it has been switched off, disabledReason.
When a recharge fails
Section titled “When a recharge fails”If the card is declined, the recharge TopUp ends Failed (PaymentFailed), nothing is credited, and
the billing email and the org’s owners and admins get an email. Auto-recharge tries again the next time the
balance is checked.
After 3 failures in a row, Nodus turns auto-recharge off, sets status.autoRecharge.disabledReason to
ConsecutiveFailures, shows a banner in the console and emails the same people. To turn it back on:
- Update the card in the billing portal:
nodus billing portal. - Run
nodus billing auto-recharge --threshold 10 --amount 50again, or setenabled: true.
If your balance runs out while auto-recharge is off, work stops gracefully as described in When money runs out.
Turn it off
Section titled “Turn it off”nodus billing auto-recharge --offThe saved card stays on file for later; remove it in the billing portal.