You can terminate instances from the command line using the Cloud API:
-
Generate an API key if you haven’t already generated one.
-
Create a file that contains the necessary payload. For example:
{ "instance_ids": [ "0920582c7ff041399e34823a0be62549" ] }
-
Run the following command:
curl -u API-KEY: https://cloud.lambdalabs.com/api/v1/instance-operations/terminate -d @INSTANCE-IDS -H "Content-Type: application/json" | jq .
Replace API-KEY with your actual API key. Don’t remove the trailing colon (:).
Replace INSTANCE-IDS with the name of the payload file you created in the previous step.