Cancelling a task
Stop a generation that has not started yet.
POST /api/v1/tasks/{taskId}/cancel
curl -X POST https://app.piernode.com/api/v1/tasks/\{taskId\}/cancel \
-H "Authorization: Bearer $PIERNODE_API_KEY"A task that is still QUEUED becomes CANCELLED and its reserved cost is
returned to your balance in full.
In practice that window is short. A worker usually picks a task up within a
second or two of it being accepted, so treat cancellation as a way to withdraw a
submission you regretted immediately, not as a general stop button. If it
returns 409, the work is already running and will finish.
Only queued tasks can be cancelled
Once a task is PROCESSING the work is already running upstream and cannot be
recalled, so cancelling returns 409 and the task continues. PierNode does not
pretend to stop work it cannot stop — if it did, you would be charged for a
generation the API had told you was cancelled.
If a processing task fails on its own, you are refunded as normal.
| Task status | Result |
|---|---|
QUEUED | 200 — cancelled and refunded. |
PROCESSING | 409 — continues running. |
| Already final | 409 — nothing to cancel. |
| Not yours, or no such id | 404. |