On Beam, each execution of a function creates a task. Tasks can be cancelled via API or the web UI. When a task is cancelled, it is stopped immediately. You will not be billed for any additional execution time after a task is stopped.

Any task can be cancelled through the API, or through the web dashboard.

Cancelling tasks through the API

Tasks can be cancelled through the api.beam.cloud/v1/task/cancel/ endpoint.

curl -X DELETE --compressed 'https://api.beam.cloud/v1/task/cancel/' \
  -H 'Authorization: Basic [YOUR_AUTH_TOKEN]' \
  -H 'Content-Type: application/json' \
  -d '{"task_ids": ["TASK_ID"]}'

This API accepts a list of tasks, which can be passed in like this:

{
   "task_ids":[
      "70101e46-269c-496b-bc8b-1f7ceeee2cce",
      "81bdd7a3-3622-4ee0-8024-733227d511cd",
      "7679fb12-94bb-4619-9bc5-3bd9c4811dca"
   ]
}

Cancelling tasks through the dashboard

Tasks can also be cancelled in the dashboard. On the tasks page, click on an individual task.

A sidebar will open, and you will have the option to cancel the task.