Skip to main content
PUT
/
v1
/
billing
/
auto-topup
curl -X PUT https://gpuoutlet.ai/v1/billing/auto-topup \
  -H "Content-Type: application/json" \
  --cookie "sid=$SID" \
  -d '{"enabled":true,"thresholdCents":2500,"topupAmountCents":10000}'
{
  "enabled": true,
  "thresholdCents": 2500,
  "topupAmountCents": 10000
}
Requires a saved card on file (see Card on file).
enabled
boolean
required
Master switch.
thresholdCents
number
When availableCents falls below this value, an auto-topup fires. Required if enabled=true. Range: 100100000 (11–1,000).
topupAmountCents
number
How much to add when the threshold trips. Range: 1000500000 (1010–5,000).
curl -X PUT https://gpuoutlet.ai/v1/billing/auto-topup \
  -H "Content-Type: application/json" \
  --cookie "sid=$SID" \
  -d '{"enabled":true,"thresholdCents":2500,"topupAmountCents":10000}'
{
  "enabled": true,
  "thresholdCents": 2500,
  "topupAmountCents": 10000
}

How it fires

A background worker checks every running rental’s heartbeat. After each metering tick, if availableCents < thresholdCents AND auto-topup is enabled AND a saved card exists, we:
  1. Charge the saved card for topupAmountCents via Stripe PaymentIntent
  2. On success: write an auto_topup ledger entry, credit the wallet
  3. On failure: disable auto-topup, send an email asking the user to update their card
There’s a 5-minute cooldown per user so a momentarily-dipping balance doesn’t get topped up repeatedly within the same second.

Caps

No hard daily cap is enforced server-side today. If you’re worried about runaway burn, set topupAmountCents to a conservative value and rely on the cooldown.