CH·02CLI reference

gpu watch update

Change a watch rule without deleting it

Change a watch rule without deleting it

Synopsis

Changes one or more fields of an existing watch rule in place. Only the flags you pass are sent — everything you leave off keeps its stored value, so an update can never silently rewrite a field you did not name.

Before this command existed the only way to change a threshold was to delete the rule and create a new one, which cost the rule its id and its firing history to change one number. Changing a notification is the safe direction, and it should not be harder than making one.

Passing no flags at all changes nothing and is refused, rather than being sent as an empty edit — an empty edit would still re-arm the rule (see below) and change nothing else, which is a side effect nobody asked for.

--gpu-model cannot be cleared: a rule always watches a model. --threshold must be greater than 0; the in-stock condition takes no threshold at all. Every enum is validated before any request is issued, so a typo costs no round trip.

On success the updated rule is printed the same way gpu watch get prints it, including the CURRENT column — which reports on-demand availability only, matching what alerts evaluate. See gpu watch list for how to read that column.

An update RE-ARMS the rule

A rule that had already fired is set back to armed and its latch is cleared. That is deliberate: the latch described the old condition, and carrying it across an edit would silently suppress the first alert on the new one.

The practical consequence is that an edit can be followed immediately by an alert, if the market already satisfies the rule you just saved. That is the rule working, not a duplicate of the alert you got before the edit.

Clearing an optional filter

Pass an empty value to take an optional filter back to "any":

gpu watch update <rule-id> --region ""           # watch every region again
gpu watch update <rule-id> --capacity-class ""   # watch both classes again
gpu watch update <rule-id> --webhook-endpoint "" # back to your org's registered endpoints

An empty value is sent as an explicit null, which the API distinguishes from a field you simply did not mention. Omitting the flag keeps the stored value; passing it empty clears it.

Re-enabling a rule that GPU.ai disabled: two different refusals

GPU.ai stops a rule by itself in one case — its creator can no longer be reached in your organization. The alert that rule fires is still addressed to that person, so --enabled on such a rule is re-checked before it is allowed, and the check has three answers, not two. Two of them are refusals, and they ask you for opposite things:

RefusalWhat it meansWhat to do
Definitivethe rule was NOT changed, and retrying this exact command will not helpThe creator is confirmed gone. The rule cannot be re-pointed at them.Delete the rule and create it again; the new rule takes you as its creator. Retrying will not change the answer.
Retryablethe rule was NOT changed, and this is RETRYABLEWe could not verify the creator right now. This is an admission that we do not know, never a statement that anybody has left.Run the same command again in a moment.

Both messages say the rule was left alone, and both are true: a refused re-enable applies nothing at all, so there is no half-applied edit to undo. The two are separated by the HTTP status the API returns (422 definitive, 503 creator_check_unavailable), never by the wording of the detail — so a reworded message cannot quietly turn an outage into a departure.

This gate applies only to a rule GPU.ai disabled. A rule you parked yourself with --enabled=false comes back with no check, and ordinary edits — a threshold, a region, a condition — are never gated on it.

This command still cannot spend

There is no launch flag and no spend cap here, for the same structural reason gpu watch create has none. To have matching capacity launched automatically, create an auto-launch rule with gpu autolaunch create, which is a separate resource with its own spend consent.

gpu watch update <rule-id> [flags]

Examples

# Move the threshold on an existing rule — the id and the rule's history are kept
gpu watch update 8b1f0c4e-2a55-4f13-9d84-6c2b7e0a3f91 --threshold 3.50

# Change what the rule alerts on
gpu watch update 8b1f0c4e-2a55-4f13-9d84-6c2b7e0a3f91 --condition in-stock

# Narrow an existing rule to one region and one capacity class
gpu watch update 8b1f0c4e-2a55-4f13-9d84-6c2b7e0a3f91 \
  --region us-west --capacity-class secure

# Widen it back out again: an empty value clears the filter
gpu watch update 8b1f0c4e-2a55-4f13-9d84-6c2b7e0a3f91 --region "" --capacity-class ""

# Park a rule without deleting it, then bring it back
gpu watch update 8b1f0c4e-2a55-4f13-9d84-6c2b7e0a3f91 --enabled=false
gpu watch update 8b1f0c4e-2a55-4f13-9d84-6c2b7e0a3f91 --enabled

# Route this rule's alerts to one specific registered endpoint (an id, not a URL)
gpu watch update 8b1f0c4e-2a55-4f13-9d84-6c2b7e0a3f91 \
  --webhook-endpoint 3f9c1c2a-5b6d-4a71-9c3e-2f8a1d0b7e45

Options

      --capacity-class string          Narrow the rule to one capacity class: secure or community. Pass an empty value to watch both again
      --condition string               Change what the rule alerts on. One of: price-under, in-stock, count-at-least
      --enabled                        Enable (--enabled) or park (--enabled=false) the rule. Omit the flag to leave it as it is (default true)
      --gpu-model string               Change which GPU model the rule watches (a model id, e.g. h100_sxm)
  -h, --help                           help for update
      --region string                  Narrow the rule to a canonical region, e.g. us-west. Pass an empty value to watch every region again
      --threshold float                Change the number the condition compares against: a per-GPU hourly price for price-under, a unit count for count-at-least
      --webhook-endpoint endpoint-id   Route this rule's alerts to one specific webhook endpoint, given as the endpoint-id shown by 'gpu webhooks list'. Not a URL. Pass an empty value to go back to your organization's registered endpoints

Limits

Your organization can have up to 50 enabled watch rules. Disabled rules do not count, so --enabled=false parks a rule for free — but re-enabling one when you are already at the ceiling is refused with a validation error naming the number.

Options inherited from parent commands

      --api-base string   API base URL (override with GPUAI_API_BASE env) (default "https://api.gpu.ai/v1")
      --debug             Enable debug logging to stderr
  -o, --output string     Output format: table|json (default table on TTY, json otherwise)

SEE ALSO

← The gpu CLI