Quickstart
Create, access, and terminate your first GPU instance using the FluidStack API
Overview
This FluidStack API tutorial leads you through the following steps:
- Create your first GPU instance.
- Check the status of your instance.
- Access your instance using an SSH client and your SSH key.
- Terminate your instance.
Tip
If you’d rather use the FluidStack Dashboard UI to manage instances instead of the API, see: Dashboard - Instances.Prerequisites
Steps
Create a GPU instance
In this step, you will create an instance with the following configuration and operating system template:
Note
If you prefer, you can use a different instance configuration and/or operating system.
Let’s create your first instance! Copy this cURL command:
Warning
The$
and >
characters are not intended to be copied.Paste the command to a location where you can edit its text in plaintext format, such as a code editor. Replace the text <api_key>
with your API key, and my_ssh_key
with the name of an SSH key on your account.
If your request succeeds, the endpoint will respond with the created instance’s id
, name
, gpu_type
, and operating_system_label
:
Take note of the id
of your instance for the next step.
Note
Did you notice that the cURL command you sent did not specify an operating_system_label
?
When the instance name is not specified, a randomized string is used. When the operating system is not specified, a default value is used. The only values you’re required to specify when creating an instance are the instance gpu_type
, and ssh_key
.
Check the status of your instance
Request the instance’s status using the List user instances endpoint:
Initially, the instance’s status
will be pending
. Once the instance is created and available, its status
will update to running
and FluidStack will assign it an IP address.
Example:
This endpoint returns a JSON array of all the instances on your account, with each instance represented as an object in the array.
Locate the instance object with the id
of your newly created instance. Take note of that instance’s values for username
and ip_address
for the next step.
Access your instance
Once the instance’s status is running
, you can connect to it using SSH. Use the private key that corresponds to the public key you used when creating the SSH key for this instance, and the username
and ip_address
you noted in the previous step.
Examples:
Note
The first time you connect to your instance, you will see a message that says “The authenticity of hostx.x.x.x
can’t be established … Are you sure you want to continue connecting”. This is normal for the first connection. Type yes
and press Enter
.When you have successfully logged in, notice that your command prompt has changed. All commands that you enter into this command prompt are executed on your instance.
When you’re ready to close your connection and log out from the instance, type exit
into your SSH session’s command prompt and press Enter
. You should be returned to your local machine’s command prompt.
Terminate your instance
To terminate your instance, first close your SSH connection, then call the API using the cURL command below. Replace the text instance_id
in the endpoint’s path with the id
you received when you created the endpoint, and <api_key>
with your API key.
Example:
To confirm that your instance was deleted, call the List user instances endpoint again as in Step 2.
Congratulations! You have successfully created an instance, accessed it using SSH, and deleted the instance.
What’s next
- Learn more about managing instances.
- Learn more about SSH.
- View the API Reference.