Skip to content

When money runs out

View Markdown

Credits are prepaid. Before paid work starts, Nodus places a funded hold on your balance, and it renews that hold every 5 minutes while the work runs. When a renewal cannot be funded, from your balance, a Budget or a maxCostUSD cap, the work stops gracefully inside time that is already paid for. Nothing runs past what you funded, and nothing is lost that the work saved.

A create that cannot be funded is refused at once with the amounts and the fix:

402 InsufficientCredits
job "train-a" needs a $3.20 hold to start (released when it ends); available $1.10.
fix: nodus billing top-up 20, or lower spec.maxCostUSD

Other refusals are BudgetExceeded (a Budget or a cap has too little left), ArrearsOutstanding (unpaid charges) and PaymentDisputed. A distributed Job checks all of its nodes together: it starts with every node funded or not at all.

When your available balance falls below $5, or below 20 % of what the next renewal of your running work needs, you get a LowBalance Event, a billing.low_balance webhook, at most one email a day and a console banner. Running work whose funds will run out soon still shows Funded=True, and the condition’s message gives the time it will stop. A top-up, a credit grant or an auto-recharge before that time keeps it running.

When a charge is larger than what is left, the rest becomes unpaid charges. You get an ArrearsPosted Event, a billing.arrears_posted webhook and at most one email a day, and new work waits until a top-up or credit grant pays them.

Kind What happens State Resumes
Job (checkpointed) Takes an urgent checkpoint, then stops Suspended, Funded=False Automatically once funded, from the checkpoint
Job (restartable or ephemeral) Stops at the funded edge Suspended, Funded=False Automatically; ephemeral Jobs restart from the start
Job at maxCostUSD Checkpoints, then stops Suspended, reason MaxCostReached When you raise maxCostUSD
Distributed Job Every node checkpoints together, then all stop Suspended, Funded=False Automatically, with all nodes funded
Sandbox Snapshots its filesystem and state, then stops Stopped, stopReason: InsufficientCredits; spec.state stays Running On the next exec or connect once funded
Workspace Saves the home volume, then stops Stopped with the money reason On nodus start, SSH connect or the schedule once funded
AgentRun Finishes or interrupts the current step Waiting for funds Automatically
Agent idle workers Scale to zero Funded=False on the Agent Automatically
Function Stops taking calls, finishes in-flight calls, scales to zero New calls queue with Funded=False Automatically
TrainingJob Its Jobs suspend; grading Sandboxes are deleted Suspended Automatically
Image build The build stops Image Pending, Funded=False Automatically rebuilds
Volume import or export The transfer stops ImportFailed(InsufficientCredits) nodus request reimport volume/<name>
Inference New requests return an OpenAI- or Anthropic-shaped 402; in-flight requests finish — Immediately

Nodus never changes the spec.state you set. It records the stop in the object’s phase and Funded condition, emits FundingLost, and emits FundingRestored when it resumes. You get at most one email an hour listing stopped work.

Terminal window
nodus billing top-up 20
nodus get jobs --watch

A top-up resumes waiting work oldest first, as each hold fits. Work stopped by a Budget resumes when you raise the Budget’s limit, switch it to Notify, delete it or the next month starts; work stopped at maxCostUSD resumes when you raise the cap.