Skip to main content

Spend Controls

Spend Controls bound how quickly queued work can consume cloud resources. They are separate from Notifications: controls change dispatch behavior, while Notifications report activity.

Controls never kill a running Job or Server. They decide whether a queued deployment may begin provisioning.

GuardrailPurposeMeasurementClears
ThrottleLimit concurrent burn rateEstimated live dollars per hourAs VMs finish
BudgetLimit spend in a periodSettled plus estimated spendAt the UTC reset

Start with both controls

For an autonomous coding-agent session:

anycloud throttle set 20 --agent-session
anycloud budget set 200 --per day --agent-session
anycloud spend show

Add account-wide controls to bound all human and agent activity:

anycloud throttle set 100
anycloud budget set 3000 --per month

Account and per-session controls coexist; every applicable control is checked.

Throttle live burn rate

Before dispatch, the scheduler compares:

estimated running VM $/hr + candidate VM $/hr >= throttle cap

If true, the deployment remains queued. The scheduler checks again every few seconds, and dispatches automatically when enough live cost finishes.

anycloud throttle set 20
anycloud throttle show
anycloud throttle unset

The candidate is pre-charged to prevent several queued Jobs from all passing against the same pre-burst rate. If the candidate cannot be priced, the throttle falls back to the current live rate.

Budget a UTC period

Budgets compare settled cloud billing data plus estimated unsettled VM cost against a calendar window:

anycloud budget set 100 --per day
anycloud budget set 500 --per week
anycloud budget set 2000 --per month
anycloud budget show

Windows reset at:

  • Day: 00:00 UTC
  • Week: Monday 00:00 UTC
  • Month: the first day at 00:00 UTC

Daily, weekly, and monthly budgets can coexist at account and agent-session scope. A budget does not pre-charge the candidate, so a small amount of overshoot is possible before the next scheduler check.

When a cap is reached

anycloud submit still returns a deployment ID. The deployment remains queued, and status or list reports the binding cap and, for a budget, its next reset:

anycloud status <deployment-id>
anycloud list --status queued

If Slack Notifications are configured, Anycloud sends one waiting-on-cap alert when a control begins blocking and at most one reminder every six hours while it remains blocked.

Agent-session scope

The CLI recognizes Claude Code, Codex, Cursor, and Aider sessions and tags their deployments. Each --agent-session control is counted separately, so one session reaching its limit does not block another.

Interactive terminal submissions have no agent session and therefore are not covered by session-only controls. Pair them with account-wide controls when you also need a global ceiling.

Use structured output to inspect remaining headroom:

anycloud spend show --json

See Spend command reference for exact scopes, filters, and output fields.