Stop and start instances

How to stop and start an instance with the FluidStack API

You can only stop an instance that has the status of running, and you can only start an instance that has the status of stopped. The instance’s id is required to stop or start it. To find the id and status of an instance, see List instances or Fetch a single user instance.

Stop an instance

Call the Stop an instance endpoint:

PUT
1curl -X PUT https://platform.fluidstack.io/instances/{instance_id}/stop \
2 -H "api-key: <api-key>"

You must provide your own API key in the header of the request.

Also, replace the text {instance_id} in the endpoint’s path with your instance’s id.

Example request with cURL:

$curl -X PUT https://platform.fluidstack.io/instances/i-1234567890/stop \
> -H "api-key: api_key_j123MyFakeAPIKey"

Example response:

Response
1{
2 "id": "i-1234567890",
3 "status": "stopped",
4 "username": "ubuntu",
5 "ssh_port": "22",
6 "ssh_keys": [
7 "my_ssh_key"
8 ],
9 "ip_address": "192.0.2.0",
10 "name": "my_instance_name",
11 "configuration": {
12 "id": "c-1234567890",
13 "gpu_model": {
14 "name": "RTX_A5000_24GB",
15 "memory_size_gb": 24
16 },
17 "cpu_model": "generic",
18 "gpu_count": 1,
19 "cpu_count": 8,
20 "nvme_storage_size_gb": 200,
21 "memory_size_gb": 30,
22 "estimated_provisioning_time_minutes": 5
23 },
24 "created_at": "2024-06-19T21:01:42.660889"
25}

If your request succeeds, the endpoint will respond with a status code of 200 and JSON object containing your instance’s details, including its current status.

The instance status should show as either stopping or stopped. In this state, your instance is offline and cannot be used or reached until you restart it.

For further details, see the API Reference.

Start an instance

Call the Start an instance endpoint:

PUT
1curl -X PUT https://platform.fluidstack.io/instances/{instance_id}/start \
2 -H "api-key: <api-key>"

You must provide your own API key in the header of the request.

Also, replace the text {instance_id} in the endpoint’s path with your instance’s id.

Example request with cURL:

$curl -X PUT https://platform.fluidstack.io/instances/i-1234567890/start \
> -H "api-key: api_key_j123MyFakeAPIKey"

Example response:

Response
1{
2 "id": "i-1234567890",
3 "status": "running",
4 "username": "ubuntu",
5 "ssh_port": "22",
6 "ssh_keys": [
7 "my_ssh_key"
8 ],
9 "ip_address": "192.0.2.0",
10 "name": "my_instance_name",
11 "configuration": {
12 "id": "c-1234567890",
13 "gpu_model": {
14 "name": "RTX_A5000_24GB",
15 "memory_size_gb": 24
16 },
17 "cpu_model": "generic",
18 "gpu_count": 1,
19 "cpu_count": 8,
20 "nvme_storage_size_gb": 200,
21 "memory_size_gb": 30,
22 "estimated_provisioning_time_minutes": 5
23 },
24 "created_at": "2024-06-19T21:01:42.660889"
25}

If your request succeeds, the endpoint will respond with a status code of 200 and an JSON object containing your instance’s details, including its current status. The instance status should show as either pending or running.

For further details, see the API Reference.