from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.virtual_machines.list(extra_fields_virtual_machines="credentials", page_size=20, page_number=1)
while res is not None:
# Handle items
res = res.next()package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.VirtualMachines.List(ctx, operations.IndexVirtualMachineRequest{
ExtraFieldsVirtualMachines: latitudeshgosdk.Pointer("credentials"),
})
if err != nil {
log.Fatal(err)
}
if res.VirtualMachines != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.virtualMachines.list({
extraFieldsVirtualMachines: "credentials",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://api.latitude.sh/virtual_machines \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/virtual_machines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/virtual_machines",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/virtual_machines")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/virtual_machines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "vm_zlkg1DegdvZE5",
"type": "virtual_machines",
"attributes": {
"name": "my-new-vm",
"status": "Running",
"created_at": "2026-01-14T15:57:14+00:00",
"primary_ipv4": "192.168.1.100",
"credentials": {
"username": "ubuntu",
"host": "192.168.1.100",
"password": "secure_password",
"ssh_keys": []
},
"operating_system": null,
"site": "MEX192",
"billing": "hourly",
"plan": {
"id": "plan_059EqYVjDQj8p",
"name": "g3.l40s.medium-142"
},
"specs": {
"vcpu": null,
"ram": null,
"storage": null,
"nic": "1 x 1 Gbps",
"gpu": "1 x NVIDIA H100 Tensor Core GPU"
},
"team": {
"id": "team_1ejNe2b5gQiKpxYNxz0bFm2yY38",
"name": "701 Team",
"slug": "701-team",
"description": "701 Team",
"address": "29825 Klocko Trafficway, Wunschhaven, KS 74888",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
},
"project": {
"id": "proj_w49QDB2WDagKb",
"name": "Intelligent Granite Pants",
"slug": "intelligent-granite-pants",
"description": "Aerodynamic Copper Bottle",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 1,
"vlans": 0
}
}
}
}
]
}{
"errors": [
{
"code": "VALIDATION_ERROR",
"status": "400",
"title": "Validation Error",
"detail": "contains unsupported field: region",
"source": {
"parameter": "sort"
},
"meta": {
"attribute": "sort",
"message": "contains unsupported field: region"
}
}
]
}List VMs
Show all Team’s Virtual Machines.
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.virtual_machines.list(extra_fields_virtual_machines="credentials", page_size=20, page_number=1)
while res is not None:
# Handle items
res = res.next()package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.VirtualMachines.List(ctx, operations.IndexVirtualMachineRequest{
ExtraFieldsVirtualMachines: latitudeshgosdk.Pointer("credentials"),
})
if err != nil {
log.Fatal(err)
}
if res.VirtualMachines != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.virtualMachines.list({
extraFieldsVirtualMachines: "credentials",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://api.latitude.sh/virtual_machines \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/virtual_machines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/virtual_machines",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/virtual_machines")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/virtual_machines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "vm_zlkg1DegdvZE5",
"type": "virtual_machines",
"attributes": {
"name": "my-new-vm",
"status": "Running",
"created_at": "2026-01-14T15:57:14+00:00",
"primary_ipv4": "192.168.1.100",
"credentials": {
"username": "ubuntu",
"host": "192.168.1.100",
"password": "secure_password",
"ssh_keys": []
},
"operating_system": null,
"site": "MEX192",
"billing": "hourly",
"plan": {
"id": "plan_059EqYVjDQj8p",
"name": "g3.l40s.medium-142"
},
"specs": {
"vcpu": null,
"ram": null,
"storage": null,
"nic": "1 x 1 Gbps",
"gpu": "1 x NVIDIA H100 Tensor Core GPU"
},
"team": {
"id": "team_1ejNe2b5gQiKpxYNxz0bFm2yY38",
"name": "701 Team",
"slug": "701-team",
"description": "701 Team",
"address": "29825 Klocko Trafficway, Wunschhaven, KS 74888",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
},
"project": {
"id": "proj_w49QDB2WDagKb",
"name": "Intelligent Granite Pants",
"slug": "intelligent-granite-pants",
"description": "Aerodynamic Copper Bottle",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 1,
"vlans": 0
}
}
}
}
]
}{
"errors": [
{
"code": "VALIDATION_ERROR",
"status": "400",
"title": "Validation Error",
"detail": "contains unsupported field: region",
"source": {
"parameter": "sort"
},
"meta": {
"attribute": "sort",
"message": "contains unsupported field: region"
}
}
]
}Authorizations
Query Parameters
The project ID or Slug to filter by
The tag IDs to filter by, separated by comma, e.g. filter[tags]=tag_1,tag_2 will return VMs with tag_1 AND tag_2.
Comma-separated extra attributes that are lazy-loaded. Supported values: credentials, pending_restart. Example: extra_fields[virtual_machines]=credentials,pending_restart.
Comma-separated sort fields. Prefix a field with - for descending order. Supported fields: created_at, name, hostname, status. Example: sort=status,-created_at sorts by status ascending, then by creation date descending.
Number of items to return per page
x >= 1Page number to return (starts at 1)
x >= 1Request aggregate stats in the response meta. Use count to get the total number of records, returned as meta.stats.total.count.
Was this page helpful?