virtuOSo docs v0.8.1

REST API reference

Overview

Base URL: /api/v1/
Content-Type: All requests and responses use application/json
Versioning: Via the URL path (v1)

Authentication

The API uses two authentication methods:

1. Session Cookies (API key bootstrap)

The three /api/v1/auth/apikeys endpoints use the same session cookies as the web UI. You can also create API keys from the Profile page.

2. Bearer Token (everything else)

All other endpoints require an API key as a Bearer token:

Authorization: Bearer vmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Admin-only endpoints additionally require the key to belong to an admin user.

Getting Started

  1. Go to Profile and create an API key
  2. Copy the key (it's only shown once)
  3. Use it in the Authorization header for API calls

Client Examples

Complete working examples in four languages. Replace YOUR_API_KEY and your-server with your actual values.

List VMs

curl -sk https://your-server/api/v1/vms \
  -H 'Authorization: Bearer YOUR_API_KEY'
import requests

API = "https://your-server/api/v1"
KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {KEY}"}

vms = requests.get(f"{API}/vms", headers=headers, verify=False).json()
for vm in vms:
    print(f"{vm['name']:20s} {vm['state']:10s} {vm.get('ip', 'N/A')}")
package main

import (
    "crypto/tls"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    api := "https://your-server/api/v1"
    key := "YOUR_API_KEY"

    client := &http.Client{
        Transport: &http.Transport{
            TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
        },
    }

    req, _ := http.NewRequest("GET", api+"/vms", nil)
    req.Header.Set("Authorization", "Bearer "+key)

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    var vms []map[string]any
    json.NewDecoder(resp.Body).Decode(&vms)
    for _, vm := range vms {
        fmt.Printf("%-20s %-10s %s\n", vm["name"], vm["state"], vm["ip"])
    }
}
# Skip TLS verification for self-signed certs
$SkipCert = [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }

$Api = "https://your-server/api/v1"
$Headers = @{ "Authorization" = "Bearer YOUR_API_KEY" }

$Vms = Invoke-RestMethod -Uri "$Api/vms" -Headers $Headers -SkipCertificateCheck
$Vms | Format-Table name, state, ip -AutoSize

Launch a VM

curl -sk https://your-server/api/v1/vms \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "dev-box",
    "size": "medium",
    "os": "ubuntu-24.04",
    "disk_gb": 40
  }'
resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
    "name": "dev-box",
    "size": "medium",
    "os": "ubuntu-24.04",
    "disk_gb": 40,
})
result = resp.json()
print(f"VM {result['name']} is {result['status']}")
print(f"Password: {result['password']}")
body := strings.NewReader(`{
    "name": "dev-box",
    "size": "medium",
    "os": "ubuntu-24.04",
    "disk_gb": 40
}`)
req, _ := http.NewRequest("POST", api+"/vms", body)
req.Header.Set("Authorization", "Bearer "+key)
req.Header.Set("Content-Type", "application/json")

resp, err := client.Do(req)
if err != nil {
    panic(err)
}
defer resp.Body.Close()

var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("VM %s is %s (password: %s)\n",
    result["name"], result["status"], result["password"])
$Body = @{
    name    = "dev-box"
    size    = "medium"
    os      = "ubuntu-24.04"
    disk_gb = 40
} | ConvertTo-Json

$Result = Invoke-RestMethod -Uri "$Api/vms" -Method Post `
    -Headers $Headers -Body $Body -ContentType "application/json" `
    -SkipCertificateCheck

Write-Host "VM $($Result.name) is $($Result.status)"
Write-Host "Password: $($Result.password)"

Launch with User Script (cloud-init)

Pass a user_script field to run a script on first boot via cloud-init. The script runs as root after the VM is provisioned.

How the script runs: on on-prem VMs virtuOSo adds it to cloud-init as one runcmd script that cloud-init runs with /bin/sh. A #!/bin/bash first line has no effect there, and bash-only syntax can abort the script, so call bash explicitly when you need it. AWS instances receive it in a bash user-data file that stops at the first failing command. If Tailscale is configured, virtuOSo appends its own install and join commands after your script, so your script runs before the VM is on the tailnet. To run commands that need the tailnet, use post_tailscale_script (see the Tailscale guide).

curl -sk https://your-server/api/v1/vms \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "docker-host",
    "size": "medium",
    "os": "ubuntu-24.04",
    "disk_gb": 40,
    "user_script": "#!/bin/bash\napt-get update\napt-get install -y docker.io\nsystemctl enable --now docker"
  }'
script = """#!/bin/bash
apt-get update
apt-get install -y docker.io
systemctl enable --now docker
"""

resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
    "name": "docker-host",
    "size": "medium",
    "os": "ubuntu-24.04",
    "disk_gb": 40,
    "user_script": script,
})
print(resp.json())
body := strings.NewReader(`{
    "name": "docker-host",
    "size": "medium",
    "os": "ubuntu-24.04",
    "disk_gb": 40,
    "user_script": "#!/bin/bash\napt-get update\napt-get install -y docker.io\nsystemctl enable --now docker"
}`)
req, _ := http.NewRequest("POST", api+"/vms", body)
req.Header.Set("Authorization", "Bearer "+key)
req.Header.Set("Content-Type", "application/json")

resp, err := client.Do(req)
if err != nil {
    panic(err)
}
defer resp.Body.Close()

var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("VM %s is %s\n", result["name"], result["status"])
$Script = @"
#!/bin/bash
apt-get update
apt-get install -y docker.io
systemctl enable --now docker
"@

$Body = @{
    name        = "docker-host"
    size        = "medium"
    os          = "ubuntu-24.04"
    disk_gb     = 40
    user_script = $Script
} | ConvertTo-Json

$Result = Invoke-RestMethod -Uri "$Api/vms" -Method Post `
    -Headers $Headers -Body $Body -ContentType "application/json" `
    -SkipCertificateCheck

Write-Host "VM $($Result.name) is $($Result.status)"

Launch from ISO

Boot a VM from a custom ISO file. Upload ISOs via the Settings page (Storage tab), then reference the full path. VNC is automatically enabled for ISO boots.

curl -sk https://your-server/api/v1/vms \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "custom-os",
    "size": "medium",
    "iso": "/var/lib/vm-lab/vms/isos/ubuntu-server.iso"
  }'
resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
    "name": "custom-os",
    "size": "medium",
    "iso": "/var/lib/vm-lab/vms/isos/ubuntu-server.iso",
})
print(resp.json())

Launch with Bridged Networking

Use bridged: true to place the VM on the LAN with a real IP from your router's DHCP, instead of the default NAT network. Requires a host bridge (br0) to be configured on the server.

curl -sk https://your-server/api/v1/vms \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "lan-server",
    "size": "medium",
    "os": "ubuntu-24.04",
    "bridged": true
  }'
resp = requests.post(f"{API}/vms", headers=headers, verify=False, json={
    "name": "lan-server",
    "size": "medium",
    "os": "ubuntu-24.04",
    "bridged": True,
})
print(resp.json())

VM Lifecycle (start, stop, restart, kill, delete)

# Start
curl -sk -X POST https://your-server/api/v1/vms/dev-box/start \
  -H 'Authorization: Bearer YOUR_API_KEY'

# Stop (graceful shutdown)
curl -sk -X POST https://your-server/api/v1/vms/dev-box/stop \
  -H 'Authorization: Bearer YOUR_API_KEY'

# Restart
curl -sk -X POST https://your-server/api/v1/vms/dev-box/restart \
  -H 'Authorization: Bearer YOUR_API_KEY'

# Kill (force stop)
curl -sk -X POST https://your-server/api/v1/vms/dev-box/kill \
  -H 'Authorization: Bearer YOUR_API_KEY'

# Delete
curl -sk -X DELETE https://your-server/api/v1/vms/dev-box \
  -H 'Authorization: Bearer YOUR_API_KEY'
# Start
requests.post(f"{API}/vms/dev-box/start", headers=headers, verify=False)

# Stop (graceful shutdown)
requests.post(f"{API}/vms/dev-box/stop", headers=headers, verify=False)

# Restart
requests.post(f"{API}/vms/dev-box/restart", headers=headers, verify=False)

# Kill (force stop)
requests.post(f"{API}/vms/dev-box/kill", headers=headers, verify=False)

# Delete
requests.delete(f"{API}/vms/dev-box", headers=headers, verify=False)
// Helper function for simple actions
func vmAction(client *http.Client, api, key, vm, action, method string) error {
    url := fmt.Sprintf("%s/vms/%s", api, vm)
    if action != "" {
        url += "/" + action
    }
    req, _ := http.NewRequest(method, url, nil)
    req.Header.Set("Authorization", "Bearer "+key)
    resp, err := client.Do(req)
    if err != nil {
        return err
    }
    resp.Body.Close()
    return nil
}

vmAction(client, api, key, "dev-box", "start", "POST")    // Start
vmAction(client, api, key, "dev-box", "stop", "POST")     // Stop
vmAction(client, api, key, "dev-box", "restart", "POST")  // Restart
vmAction(client, api, key, "dev-box", "kill", "POST")     // Kill
vmAction(client, api, key, "dev-box", "", "DELETE")        // Delete
# Start
Invoke-RestMethod -Uri "$Api/vms/dev-box/start" -Method Post `
    -Headers $Headers -SkipCertificateCheck

# Stop (graceful shutdown)
Invoke-RestMethod -Uri "$Api/vms/dev-box/stop" -Method Post `
    -Headers $Headers -SkipCertificateCheck

# Restart
Invoke-RestMethod -Uri "$Api/vms/dev-box/restart" -Method Post `
    -Headers $Headers -SkipCertificateCheck

# Kill (force stop)
Invoke-RestMethod -Uri "$Api/vms/dev-box/kill" -Method Post `
    -Headers $Headers -SkipCertificateCheck

# Delete
Invoke-RestMethod -Uri "$Api/vms/dev-box" -Method Delete `
    -Headers $Headers -SkipCertificateCheck

Full Python Script Example

#!/usr/bin/env python3
"""virtuOSo API client example. Launch a VM, wait for it, then SSH in."""
import requests, time

API = "https://your-server/api/v1"
KEY = "YOUR_API_KEY"
s = requests.Session()
s.headers["Authorization"] = f"Bearer {KEY}"
s.verify = False

# Launch a VM
resp = s.post(f"{API}/vms", json={
    "name": "test-vm",
    "size": "small",
    "os": "ubuntu-24.04",
})
print(f"Launched: {resp.json()}")

# Poll until it's running and has an IP
for _ in range(60):
    vm = s.get(f"{API}/vms/test-vm").json()
    if vm.get("ip") and vm["state"] == "running" and vm.get("cloud_init") == "done":
        print(f"Ready! IP: {vm['ip']}, password: {vm.get('password', 'N/A')}")
        break
    time.sleep(5)
else:
    print("Timed out waiting for VM")

# Clean up
# s.delete(f"{API}/vms/test-vm")

Error Format

All errors return JSON with error and status fields:

{"error": "VM not found", "status": 404}
StatusMeaning
400Bad request (invalid input)
401Unauthorized (missing or invalid auth)
403Forbidden (admin access required)
404Not found
409Conflict (duplicate name)
500Internal server error

Quick Reference

MethodEndpointAuthDescription
POST/api/v1/auth/apikeysSessionCreate API key
GET/api/v1/auth/apikeysSessionList API keys
DELETE/api/v1/auth/apikeys/{id}SessionDelete API key
GET/api/v1/meAPI KeyCurrent user info
GET/api/v1/vmsAPI KeyList VMs
POST/api/v1/vmsAPI KeyLaunch VM
GET/api/v1/vms/{name}API KeyGet VM details
DELETE/api/v1/vms/{name}API KeyDelete VM
POST/api/v1/vms/{name}/startAPI KeyStart VM
POST/api/v1/vms/{name}/stopAPI KeyGraceful shutdown
POST/api/v1/vms/{name}/killAPI KeyForce stop
POST/api/v1/vms/{name}/restartAPI KeyReboot VM
POST/api/v1/vms/{name}/resizeAPI KeyResize disk
PUT/api/v1/vms/{name}/autostartAPI KeySet autostart
PUT/api/v1/vms/{name}/networkAPI KeyChange network mode
PUT/api/v1/vms/{name}/protectedAPI KeySet delete protection
GET/api/v1/vms/{name}/notesAPI KeyGet a VM's notes
PUT/api/v1/vms/{name}/notesAPI KeyReplace a VM's notes
GET/api/v1/usersAdminList users
POST/api/v1/usersAdminCreate user
GET/api/v1/users/{id}AdminGet user
DELETE/api/v1/users/{id}AdminDelete user
PUT/api/v1/users/{id}/passwordAdminReset password
GET/api/v1/vms/{name}/accessAdminList VM access
POST/api/v1/vms/{name}/accessAdminGrant access
DELETE/api/v1/vms/{name}/access/{user_id}AdminRevoke access
GET/api/v1/sshkeysAPI KeyList SSH keys
POST/api/v1/sshkeysAPI KeyAdd SSH key
DELETE/api/v1/sshkeys/{id}API KeyDelete SSH key
GET/api/v1/stacksAPI KeyList stacks
POST/api/v1/stacksAPI KeyCreate a stack
GET/api/v1/stacks/{name}API KeyGet stack
PUT/api/v1/stacks/{name}API KeyUpdate stack template
DELETE/api/v1/stacks/{name}API KeyDelete stack
POST/api/v1/stacks/{name}/deployAPI KeyDeploy stack VMs
POST/api/v1/stacks/{name}/destroyAPI KeyTear down stack VMs
GET/api/v1/secretsAPI KeyList global secrets (metadata only)
POST/api/v1/secretsAPI KeyCreate a global secret
GET/api/v1/secrets/{id}/valueAPI KeyReveal a global secret
PUT/api/v1/secrets/{id}API KeyUpdate a global secret
DELETE/api/v1/secrets/{id}API KeyDelete a global secret
GET/api/v1/stacks/{name}/secretsAPI KeyList per-stack secrets
POST/api/v1/stacks/{name}/secretsAPI KeyCreate a per-stack secret
GET/api/v1/stacks/{name}/secrets/{id}/valueAPI KeyReveal a per-stack secret
PUT/api/v1/stacks/{name}/secrets/{id}API KeyUpdate a per-stack secret
DELETE/api/v1/stacks/{name}/secrets/{id}API KeyDelete a per-stack secret
GET/api/v1/stack-templatesAPI KeyList saved templates
POST/api/v1/stack-templatesAPI KeySave a template
DELETE/api/v1/stack-templates/{id}API KeyDelete a saved template
GET/api/v1/apps/k8s/clustersAdminList Kubernetes clusters
POST/api/v1/apps/k8s/clustersAdminCreate a cluster
GET/api/v1/apps/k8s/clusters/{name}AdminGet a cluster and its workers
DELETE/api/v1/apps/k8s/clusters/{name}AdminDelete a cluster
POST/api/v1/apps/k8s/clusters/{name}/scaleAdminSet the worker count
POST/api/v1/apps/k8s/clusters/{name}/addonsAdminInstall ArgoCD, Headlamp or k9s
GET/api/v1/apps/k8s/clusters/{name}/credentialsAdminArgoCD password and Headlamp token
GET/api/v1/apps/k8s/clusters/{name}/kubeconfigAdminDownload the kubeconfig
GET/api/v1/apps/docker/instancesAdminList Docker instances
POST/api/v1/apps/docker/instancesAdminCreate a Docker instance
GET/api/v1/apps/docker/instances/{name}AdminGet a Docker instance
DELETE/api/v1/apps/docker/instances/{name}AdminDelete a Docker instance
GET/api/v1/hostAdminHost CPU, memory and VM storage, plus resources allocated to VMs
GET/api/v1/fleet/nodesAdminList the other servers in the fleet with status, resources and VM counts
POST/api/v1/fleet/nodesAdminAdd a server to the fleet (returns 201)
DELETE/api/v1/fleet/nodes/{id}AdminRemove a server from the fleet (its VMs are not touched)
POST/api/v1/fleet/nodes/{id}/trust-certificateAdminTrust the certificate a server presents now
POST/api/v1/fleet/refreshAdminCheck every server now
GET/api/v1/fleet/vmsAdminList VMs across all servers, filter with node and provider
POST/api/v1/fleet/aws/instancesAdminLaunch an EC2 instance (costs money, returns 202)
DELETE/api/v1/fleet/aws/instances/{id}AdminTerminate an instance launched from Fleet and remove its security groups
POST/api/v1/fleet/aws/instances/{id}/keepAdminCancel an instance's automatic termination
POST/api/v1/fleet/aws/instances/{id}/extendAdminAdd hours or days to an instance's automatic termination
GET/api/v1/fleet/awsAdminEC2 instances virtuOSo launched in this server's AWS account, with an estimated cost
GET/api/v1/fleet/placementAdminRank this server and every node by room for a new VM
POST/api/v1/fleet/vmsAdminLaunch a cloud image VM on the best fit or a chosen server
GET/api/v1/fleet/move/checkAdminSay whether a VM can move to another server, and for how long it would be stopped
POST/api/v1/fleet/moveAdminMove a VM to another server (returns a move to follow, 202)
GET/api/v1/fleet/movesAdminRecent moves, newest first
GET/api/v1/fleet/moves/{id}AdminOne move: its state, step, new address, or why it failed
POST/api/v1/fleet/moves/{id}/cancelAdminCancel a move that is running; it puts everything back
DELETE/api/v1/fleet/vms/{node}/{name}AdminDelete a stopped VM on a fleet server, with its disk and snapshots (send confirm=true)
GET/api/v1/fleet/heldAdminThe originals of moved VMs being kept, across every server, with the space they use
POST/api/v1/fleet/held/{node}/{id}/restoreAdminBring a held original back, stopped and with its schedule off
DELETE/api/v1/fleet/held/{node}/{id}AdminDelete a held original for good, to free its space
PUT/api/v1/fleet/managerAdminTell this server which server manages it, used by Fleet
DELETE/api/v1/fleet/managerAdminLet this server go from its manager, used by Fleet
POST/api/v1/sso/ticketsAdminOne time sign in ticket for the key's owner, used by Fleet
GET/api/v1/vms/{name}/scheduleAPI KeyGet a VM's start and stop schedule
PUT/api/v1/vms/{name}/scheduleAPI KeyCreate or replace the schedule
DELETE/api/v1/vms/{name}/scheduleAPI KeyRemove the schedule
GET/api/v1/schedulesAdminList all schedules
GET/api/v1/vms/{name}/snapshotsAPI KeyList a VM's snapshots
POST/api/v1/vms/{name}/snapshotsAPI KeyTake a snapshot (returns 202)
DELETE/api/v1/vms/{name}/snapshots/{id}API KeyDelete a snapshot
POST/api/v1/vms/{name}/snapshots/{id}/restoreAPI KeyRestore a VM to a snapshot (returns 202)
GET/api/v1/snapshotsAdminList all snapshots
GET/api/v1/vms/{name}/restore-policyAPI KeyGet a VM's restore point policy
PUT/api/v1/vms/{name}/restore-policyAPI KeyCreate or replace the policy
DELETE/api/v1/vms/{name}/restore-policyAPI KeyRemove the policy
GET/api/v1/restore-policiesAdminList all policies

API Keys

API key management uses session cookie auth (not Bearer tokens). Create keys from the Profile page or via these endpoints.

Create API Key

POST /api/v1/auth/apikeys Session
FieldTypeRequiredDescription
namestringYesDisplay name (unique per user)

Response 201 Created:

{"id": 1, "name": "my-key", "prefix": "vmk_a1b2c3d4", "key": "vmk_a1b2c3d4e5f6...", "created_at": "..."}
The full key value is only returned at creation time. Store it securely.

List API Keys

GET /api/v1/auth/apikeys Session

Response 200 OK:

[{"id": 1, "name": "my-key", "prefix": "vmk_a1b2c3d4", "created_at": "...", "last_used": "..."}]

Delete API Key

DELETE /api/v1/auth/apikeys/{id} Session

Response 200 OK: {"ok": true}

Current User

Get Current User

GET /api/v1/me API Key

Response 200 OK:

{"id": 1, "username": "admin", "role": "admin", "created_at": "..."}

VMs

Admins see all VMs. Regular users only see VMs they've been granted access to.

List VMs

GET /api/v1/vms API Key

Response 200 OK:

[{
  "name": "web-server", "state": "running", "ip": "192.0.2.45",
  "vcpus": 1, "memory_mb": 2048, "autostart": false, "has_vnc": false,
  "disk_cap_gb": 50.0, "disk_used_gb": 4.2, "cloud_init": "done",
  "network": "default", "protected": false
}]
The network field is "default" for NAT or "bridge:br0" for bridged networking. The protected field indicates delete protection. Protected VMs cannot be deleted until protection is disabled.

Launch VM

POST /api/v1/vms API Key

Launches asynchronously. Returns immediately with status "creating".

FieldTypeRequiredDefaultDescription
namestringYesNoneVM name (alphanumeric + hyphens)
sizestringNosmallmicro, small, medium, large, xlarge, 2xlarge, 3xlarge, 4xlarge
osstringNo*Noneubuntu-26.04, ubuntu-24.04, ubuntu-22.04, fedora-43, amazon-2023 (append +desktop for GUI). Required unless iso is set
isostringNoNoneAbsolute path to an ISO file on the server. When set, the VM boots from the ISO instead of a cloud image (os is ignored, VNC is auto-enabled). ISOs uploaded via Settings are stored in /var/lib/vm-lab/vms/isos/
ssh_keystringNoNoneSSH public key to inject
disk_gbintNosize defaultDisk size in GB. When left out, the disk is the size's default: 50 GB for micro, small and medium, 100 GB for large and xlarge, 200 GB for 2xlarge and 3xlarge, 500 GB for 4xlarge
passwordstringNoautoVM user password
vncboolNofalseEnable VNC graphics
desktopboolNofalseDesktop environment (implies VNC)
user_scriptstringNoNoneCloud-init script for first boot
post_tailscale_scriptstringNoNoneBash script that runs once after Tailscale connects, via a systemd one-shot unit that survives reboots. Sees TS_IP and TS_DNSNAME. Retried at the next boot if it fails, so make it safe to run twice.
bridgedboolNofalseUse bridged networking instead of NAT (on-prem only)
providerstringNolibvirtInfrastructure provider: libvirt (on-prem) or aws
regionstringNodefaultAWS region (e.g. us-east-1). VPC and subnet are auto-provisioned. Only used when provider is aws

Response 202 Accepted:

{"name": "dev-box", "password": "auto-generated-or-provided", "status": "creating", "provider": "libvirt"}

Launch VM on AWS

curl -X POST https://YOUR_HOST/api/v1/vms \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "web-server", "os": "ubuntu-24.04", "size": "medium", "provider": "aws", "region": "us-east-1"}'

When provider is aws, virtuOSo automatically creates a VPC with public subnets if one doesn't exist in the region. See AWS Provider docs for IAM setup.

Get VM Details

GET /api/v1/vms/{name} API Key

Response 200 OK:

{
  "name": "web-server", "state": "running", "ip": "192.0.2.45",
  "vcpus": 1, "memory_mb": 2048, "autostart": false, "has_vnc": false,
  "disk_cap_gb": 50.0, "disk_used_gb": 4.2, "cloud_init": "done",
  "network": "default", "protected": false,
  "password": "the-vm-password", "os_id": "ubuntu-24.04",
  "notes": "Owner: ops team"
}
The single VM response includes the VM's notes (empty string if none). The list response does not, because notes can be large.

Delete VM

DELETE /api/v1/vms/{name} API Key

Stops and permanently deletes the VM and its disk.

Response 200 OK: {"ok": true}

Start VM

POST /api/v1/vms/{name}/start API Key

Response 200 OK: {"ok": true}

Stop VM

POST /api/v1/vms/{name}/stop API Key

Graceful shutdown (ACPI power button).

Response 200 OK: {"ok": true}

Kill VM

POST /api/v1/vms/{name}/kill API Key

Force-stops immediately.

Response 200 OK: {"ok": true}

Restart VM

This endpoint asks the guest to reboot gracefully. The MCP restart_vm tool is different: it force-stops the VM and then starts it.

POST /api/v1/vms/{name}/restart API Key

Response 200 OK: {"ok": true}

Resize VM Disk

POST /api/v1/vms/{name}/resize API Key

VM must be shut off. Disk can only be grown, not shrunk.

FieldTypeRequiredDescription
size_gbintYesNew total disk size in GB

Response 200 OK: {"ok": true}

Set Autostart

PUT /api/v1/vms/{name}/autostart API Key
FieldTypeRequiredDescription
enabledboolYestrue to enable, false to disable

Response 200 OK: {"ok": true}

Change Network Mode

PUT /api/v1/vms/{name}/network API Key

VM must be shut off. Switches between NAT and bridged networking.

FieldTypeRequiredDescription
networkstringYes"default" for NAT, or "bridge:br0" for bridged

Response 200 OK: {"ok": true}

Set Delete Protection

PUT /api/v1/vms/{name}/protected API Key

Enables or disables delete protection. Protected VMs cannot be deleted until protection is removed.

FieldTypeRequiredDescription
protectedboolYestrue to enable, false to disable

Response 200 OK: {"ok": true}

Get VM Notes

GET /api/v1/vms/{name}/notes API Key

Returns the free text (Markdown) notes shown on the VM detail page. Response 200 OK: {"vm": "web-server", "notes": "Owner: ops team"}. Returns 404 if the VM does not exist or you do not have access to it.

Set VM Notes

PUT /api/v1/vms/{name}/notes API Key

Replaces the VM's notes. The text is stored exactly as sent. Notes are never cut short: text over 64 KB is refused with 413, and text that is not valid UTF-8 is refused with 400.

FieldTypeRequiredDescription
notesstringYesThe full notes text. An empty string clears the notes. A request without this field is refused, so a mistake cannot wipe them

Response 200 OK: {"vm": "web-server", "notes": "..."}

Users (Admin Only)

These endpoints require an API key belonging to an admin user.

List Users

GET /api/v1/users Admin

Response 200 OK:

[{"id": 1, "username": "admin", "role": "admin", "created_at": "...", "updated_at": "..."}]

Create User

POST /api/v1/users Admin
FieldTypeRequiredDefaultDescription
usernamestringYesNoneUsername (unique)
passwordstringYesNonePassword (min 6 chars)
rolestringNouseradmin or user

Response 201 Created:

{"id": 3, "username": "newuser", "role": "user"}

Get User

GET /api/v1/users/{id} Admin

Response 200 OK:

{"id": 2, "username": "dev", "role": "user", "created_at": "...", "updated_at": "..."}

Delete User

DELETE /api/v1/users/{id} Admin

Cannot delete yourself.

Response 200 OK: {"ok": true}

Reset User Password

PUT /api/v1/users/{id}/password Admin
FieldTypeRequiredDescription
passwordstringYesNew password (min 6 chars)

Response 200 OK: {"ok": true}

VM Access (Admin Only)

Control which non-admin users can access which VMs. Admins can access all VMs regardless.

List VM Access

GET /api/v1/vms/{name}/access Admin

Response 200 OK:

[{"id": 2, "username": "dev", "role": "user"}]

Grant VM Access

POST /api/v1/vms/{name}/access Admin
FieldTypeRequiredDescription
user_idintYesUser ID to grant access to

Response 200 OK: {"ok": true}

Revoke VM Access

DELETE /api/v1/vms/{name}/access/{user_id} Admin

Response 200 OK: {"ok": true}

SSH Keys

Manage SSH public keys for your account. Keys can be injected into VMs at launch.

List SSH Keys

GET /api/v1/sshkeys API Key

Response 200 OK:

[{"id": 1, "name": "work-laptop", "public_key": "ssh-ed25519 AAAA...", "created_at": "..."}]

Add SSH Key

POST /api/v1/sshkeys API Key
FieldTypeRequiredDescription
namestringYesDisplay name (unique per user)
public_keystringYesSSH public key (OpenSSH format)

Response 201 Created:

{"id": 1, "name": "work-laptop", "public_key": "ssh-ed25519 AAAA...", "created_at": "..."}

Delete SSH Key

DELETE /api/v1/sshkeys/{id} API Key

Response 200 OK: {"ok": true}

Stacks, Secrets and Templates

Stacks, secrets and saved templates use the same API key authentication as the VM endpoints. Request and response details, template syntax and the ${secret.NAME} and ${vm.NAME.ip} variables are in the Stacks guide.

Apps (Admin Only)

Apps use an admin API key, the same access the web UI requires. Kubernetes clusters and Docker instances are available through the API. Creating one returns 202 Accepted and provisions in the background. Poll the GET endpoint until status is running. Common errors: 400 invalid input, 403 not an admin key, 404 not found, 409 name exists or add-on already installed.

Create Kubernetes Cluster

POST /api/v1/apps/k8s/clusters Admin

A cluster is a k3s server VM plus optional workers.

FieldTypeRequiredDefaultDescription
namestringYesNoneCluster name. The VM is named k8s-<name>
sizestringNomediumInstance size, or an AWS instance type
disk_gbintNosize defaultDisk size in GB
bridgedboolNofalseBridged networking instead of NAT (on-prem only)
argocd, headlamp, k9sboolNofalseInstall the add-on
worker_countintNo0Worker nodes, 0 to 10
providerstringNolibvirtlibvirt or aws
region, vpc_id, subnet_idstringNoNoneAWS placement
port_rulesarrayNoNoneAWS only: [{"port": 443, "source": "0.0.0.0/0"}]

Response 202 Accepted:

{"name": "prod", "vm_name": "k8s-prod", "status": "provisioning", "ip": "", "tailscale_ip": "",
 "size": "medium", "disk_gb": 0, "provider": "libvirt", "region": "",
 "argocd": true, "headlamp": false, "k9s": false, "workers": [], "created_at": "2026-10-22 10:00"}

Manage Kubernetes Clusters

EndpointDescription
GET /api/v1/apps/k8s/clustersList clusters
GET /api/v1/apps/k8s/clusters/{name}One cluster. workers is a list of {name, ip, tailscale_ip, status}; worker status is provisioning until the worker VM is up with an IP, then ready. The worker joins the cluster about a minute later, so check kubectl get nodes before scheduling work on it
DELETE /api/v1/apps/k8s/clusters/{name}Delete the cluster, its workers and stored credentials
POST .../{name}/scaleBody {"worker_count": 3}. Scale down drains and removes the newest workers first. Returns 202
POST .../{name}/addonsBody {"addon": "argocd"} (or headlamp, k9s). Returns 202, or 409 if already installed
GET .../{name}/credentials{"argocd_password": "...", "headlamp_token": "..."}, empty until the add-on has finished installing
GET .../{name}/kubeconfigThe kubeconfig as YAML. The server address is the cluster IP, or its Tailscale IP when the Kubernetes Tailscale setting is on
curl -sk -X POST https://your-server/api/v1/apps/k8s/clusters \
  -H 'Authorization: Bearer vmk_your_admin_key' -H 'Content-Type: application/json' \
  -d '{"name": "prod", "size": "large", "argocd": true, "worker_count": 2}'

Docker Instances

A VM with Docker and Compose installed. The VM's login details are on GET /api/v1/vms/{vm_name}.

EndpointDescription
POST /api/v1/apps/docker/instancesCreate. Fields: name (required; the VM is docker-<name>), size (default medium), disk_gb, bridged, provider, region, vpc_id, subnet_id, port_rules. Returns 202
GET /api/v1/apps/docker/instancesList instances
GET /api/v1/apps/docker/instances/{name}One instance: name, vm_name, status, ip, tailscale_ip, size, disk_gb, os, provider, region, created_at
DELETE /api/v1/apps/docker/instances/{name}Delete the instance and its VM

Host Capacity (Admin Only)

GET /api/v1/host Admin

Reports the host's CPU load, memory and VM storage, and what the VMs on it have been allocated. Use it to check that another VM will fit.

{
  "host": {
    "arch": "amd64", "cpu_cores": 8, "load_1": 0.4, "load_5": 0.3, "load_15": 0.2, "load_percent": 5,
    "mem_total_bytes": 33500000000, "mem_used_bytes": 9000000000, "mem_available_bytes": 24500000000, "mem_percent": 27,
    "disk_total_bytes": 1000000000000, "disk_used_bytes": 180000000000, "disk_free_bytes": 820000000000, "disk_percent": 18
  },
  "vms": {"total": 3, "running": 2, "vcpus_allocated": 6, "memory_mb_allocated": 12288}
}

Fleet

Fleet lets one virtuOSo server watch others. The Fleet server is part of its own fleet: its own load, memory, storage and VMs are listed beside its nodes, marked "local": true, read live, and counted in the totals. It cannot be removed, needs no sign in step, and is left out if its own numbers cannot be read. Every Fleet endpoint needs an admin API key. Each server in the fleet is stored with an admin API key from that server. The key is encrypted and is never returned by any call. Servers are checked every 30 seconds, and POST /api/v1/fleet/refresh checks them straight away.

Add a node

POST /api/v1/fleet/nodes Admin
FieldTypeRequiredDescription
namestringYes1 to 40 letters, numbers, dots, hyphens or underscores
addressstringYesHost name or IP address with an optional port, for example lab-02 or 192.0.2.10:443. Plain http is accepted only for the local machine
api_keystringYesAn admin API key created on that server
fingerprintstringNoExpected SHA-256 certificate fingerprint, 64 hex characters. If empty, the first certificate the server presents is saved

Response 201 with the node. The server is checked right away and is kept even if it cannot be reached yet, so you can add one that is not up. status and last_error say what is wrong. 400 for invalid input, 409 if the name is taken.

{"id": 1, "name": "lab-02", "address": "https://192.0.2.10", "status": "online", "version": "v0.7.1",
 "last_seen": "2026-11-04T20:00:10Z", "last_checked": "2026-11-04T20:00:10Z", "last_error": "",
 "certificate_fingerprint": "3f9a...", "stale": false,
 "host": {"cpu_cores": 8, "load_percent": 12.5, "mem_percent": 25, "disk_percent": 20},
 "vms": {"total": 4, "running": 3, "vcpus_allocated": 8, "memory_mb_allocated": 8192}}

status is online, offline, unauthorized (the key was refused), cert_changed (the server presents a different certificate than the one saved, so nothing is sent to it) or unknown (not checked yet). An offline server keeps its last known numbers and stale is true.

Other Fleet endpoints

  • Both list endpoints take sort and dir (asc or desc). Nodes sort by name (default), status (nodes that need attention first), cpu, memory, storage, vms, vcpus, ram or seen. VMs sort by node (default), name, state, ip (by all four numbers, each counted as a number), vcpus, ram, disk or provider. With no dir, numbers and seen go biggest or newest first and the rest ascending. Rows with no value, such as a node that has not reported, are always last. An unknown sort or dir returns 400 with the choices.
  • GET /api/v1/fleet/nodes returns (the resource totals count only nodes that are online and have reported, and load_percent is averaged over their cores) {"nodes": [...], "totals": {"nodes", "online", "vms", "running", "vcpus_allocated", "memory_mb_allocated", "reporting", "cores", "load_percent", "mem_total_bytes", "mem_used_bytes", "mem_percent", "disk_total_bytes", "disk_used_bytes", "disk_percent"}}.
  • DELETE /api/v1/fleet/nodes/{id} removes a node. {id} is the node name or its numeric id. Returns {"ok": true, "removed": "lab-02"}, or 404. Only the entry and its saved key are deleted.
  • POST /api/v1/fleet/nodes/{id}/trust-certificate forgets the saved certificate and saves the one the server presents now. Use it only after a certificate was changed on purpose. Returns the node.
  • POST /api/v1/fleet/refresh checks every node now and returns the same list as GET /api/v1/fleet/nodes. It can take a few seconds.
  • GET /api/v1/fleet/vms returns {"vms": [...], "count": N}. Each entry has node, node_id, stale and the VM's name, state, ip, vcpus, memory_mb, disk_cap_gb, provider and network. Add ?node=lab-02 and ?provider=AWS to filter. Names match without regard to case. If AWS is set up, the EC2 instances virtuOSo launched are listed too, as rows with node AWS, provider AWS, is_cloud true, their region and instance_id, and no disk_cap_gb. They come from what the service last read from AWS (see below), so listing never waits for AWS, and an instance that is already a row, because it was launched from a server's own Compute app or VM page, is not listed twice. AWS is not a server: it is never a place to move a VM to or to delete one from. Manage the instances in the AWS section of the overview.

Where a new VM fits

GET /api/v1/fleet/placement?size=large&disk_gb=120 Admin

Ranks this server and every node by how much memory and storage each would have left after the VM, best first. size is one of micro, small (default), medium, large, xlarge, 2xlarge, 3xlarge, 4xlarge; disk_gb defaults to the size's disk. It is advice: nothing is reserved.

{"request": {"size": "large", "vcpus": 2, "ram_mb": 8192, "disk_gb": 120},
 "recommended": "lab-02",
 "candidates": [
  {"node": "lab-02", "local": false, "status": "online", "verdict": "best fit", "fits": true, "recommended": true,
   "free_ram_gb": 52.1, "free_disk_gb": 1800, "load_percent": 8, "score": 0.77},
  {"node": "this server", "local": true, "status": "online", "verdict": "will not fit", "fits": false, "recommended": false,
   "reason": "needs 8.0 GB of memory plus 1.6 GB kept for the host, 6.2 GB is free", "free_ram_gb": 6.2, "free_disk_gb": 90, "load_percent": 31, "score": 0}]}

When AWS is set up it is also listed, last, with "cloud": true, verdict cloud and its estimated_hourly_usd for that size. It is never recommended.

verdict is best fit, good fit, tight (fits, but under 15% of memory or storage would be left), will not fit, offline or no numbers yet. A server that is not online is never recommended. The host keeps 10% of its memory, at least 1 GB, for itself.

Launch a VM on the fleet

POST /api/v1/fleet/vms Admin

Launches a cloud image VM on the best fit, or on the server you name.

FieldTypeRequiredDescription
namestringYesVM name
nodestringNoA node name, this server, or auto (default) for the best fit
sizestringNoSame sizes as above, default small
osstringNoCloud image id, default ubuntu-24.04. ISO and qcow2 are refused, because those files live on one server
disk_gbintNoDefaults to the size's disk
ssh_key, user_script, password, bridged, vnc, desktopNoPassed to the server that runs the VM, as for POST /api/v1/vms

node can also be aws, which launches an EC2 instance in this server's AWS account through the same launch as POST /api/v1/fleet/aws/instances, with every guard it has. That costs money, so confirm_cost must be true, and auto never chooses AWS. size picks the instance type (micro is t3.micro, small t3.small, medium t3.medium, large t3.large, xlarge t3.xlarge, 2xlarge t3.2xlarge, 3xlarge m5.2xlarge, 4xlarge m5.4xlarge), and the size's disk becomes the instance's root disk, exactly as it is the VM's disk on a server (disk_gb sets another size, 8 to 2000 GB, billed while the instance exists at about $0.08 per GB a month). region, ttl_hours and ports apply only to AWS. bridged, vnc, desktop and password are refused for AWS, not ignored. The Deploy page has the same choice in its Server picker, under Cloud.

Response: the server's own status code (normally 202) with {"node", "local", "status", "warning", "result", "candidates"}, where result is that server's answer. The VM takes a minute or two to be ready, so poll GET /api/v1/fleet/vms. Naming a server that may lack room still launches, with a warning. 409 if no server has room, or the named server is not online. 404 for an unknown server. 502 if the node cannot be reached, refuses the saved key, or presents a different certificate, in which case nothing is sent. Other refusals from the node, such as a name already in use, come back with the node's status and reason.

Deleting a VM from Fleet

DELETE /api/v1/fleet/vms/{node}/{name}?confirm=true deletes a stopped VM on a fleet server, with its disk and snapshots, for good. confirm=true (in the address or as {"confirm": true} in the body) is required, so a script cannot do it by accident. It returns {"ok": true, "node", "vm"}. It is refused with 409 if the VM is running, protected, part way through a move, or a cloud VM (those are ended where they were launched), if the server is not reachable, or if the server is on an older version that cannot check that the VM has not been started since Fleet last looked. 404 if the server or VM is not in the fleet. The server makes the last check itself (DELETE /api/v1/vms/{name}?require_stopped=true), so a Fleet list that is a few seconds old can never cause a running VM to be forced off. Its records go with it, so it does not linger in the VM list. This is not DELETE /api/v1/fleet/nodes/{id}, which takes a server out of the fleet and touches none of its VMs. The Fleet VM list has a Delete button on every stopped VM.

Moving a VM to another server

A VM can move from one fleet server to another, offline. It is stopped, its disk is copied straight from the server that has it to the new one (it does not pass through the Fleet server), and it is started there. It keeps its password, notes, schedule and restore point settings. The new copy gets a new IP address, because each server hands out its own. When the new copy is running, the original is put away on the server it came from: out of the VM list, with its disk, first boot CD, UEFI settings, snapshots and records kept in a held folder, and deleted after 7 days. Until then it can be restored or deleted. Holding it is a rename on the same disk, so it takes no extra space and no time.

GET /api/v1/fleet/move/check?vm=web1&from=lab-01&to=lab-02 says whether it can move, from what the Fleet server already knows, and changes nothing: {"vm", "from", "to", "can_move", "problems", "will_stop", "disk_gb", "downtime_minutes"}. problems lists every reason it cannot, such as a different CPU type, not enough room on the new server, a name already used there, or a node that is offline. downtime_minutes is an upper bound on how long the VM is stopped. Either server can be this server.

POST /api/v1/fleet/move with {"vm": "web1", "from": "lab-01", "to": "lab-02", "stop": true} starts it and returns 202 at once with the move: {"id", "vm", "from", "to", "state", "step", "error", "warning", "ip", "will_stop", "downtime_minutes", "started", "finished"}. stop must be true to move a VM that is running, because the VM is stopped for the whole copy; without it a running VM is refused with 409 and the number of minutes. A move that cannot happen returns 409 with problems. Follow it with GET /api/v1/fleet/moves/{id}: state is running, done or failed, step says what it is doing, ip is the new address when it is done, and error says what went wrong if it failed. GET /api/v1/fleet/moves lists the recent ones ({"moves": [...], "count": N}). POST /api/v1/fleet/moves/{id}/cancel stops a running move and puts everything back.

Held copies. GET /api/v1/fleet/held lists them across the fleet: {"nodes": [{"node", "held": [{"id", "vm", "moved_to", "held_at", "expires_at", "size_bytes"}], "count", "bytes", "error"}], "count", "bytes"}. A server that cannot be asked is listed with its error. POST /api/v1/fleet/held/{node}/{id}/restore brings one back on {node}: the VM returns stopped, with its schedule and restore points switched off and a note, because the copy that moved is running elsewhere, and its snapshots and records return with it. It is refused if the server already has a VM of that name. DELETE /api/v1/fleet/held/{node}/{id} deletes one for good, with its snapshots, and cannot be undone. Each server also deletes its own expired ones when it starts and every hour. The Fleet overview shows the space they use as a card, and warns when a server is short of storage (85% or more used) while holding some, so you know which to delete. If the original cannot be put away (for example, its files are on another disk), the move still finishes and the original is left stopped with its schedule off, and the move says why in warning.

Telling the copies apart. A copy that was brought back from a held copy, or left in the VM list because it could not be put away, remembers where the live one went: GET /api/v1/vms gives it "moved_to": "lab-02", and its own page and VM list say so. The Fleet VM list shows a small moved to lab-02 badge on that row, in amber if the copy there is running, but only while lab-02 really has a VM of that name, so a note about a move that was undone, or whose other copy was deleted, never lingers. The Delete confirmation on such a row mentions the other copy.

If something goes wrong, the move undoes itself. The original is started again if it was running, and nothing is left on the new server. If the connection to the new server is lost while it is receiving, the Fleet server asks it to undo anything unfinished, and asks whether the VM got there. If it did, the move is done. If it cannot find out, the original is left stopped, so two copies cannot run, and the move says so.

What can move. A VM you launched on its own, with one disk, on the default network, that is not protected and does not belong to an app, a Kubernetes cluster or a stack, between two servers with the same CPU type. VMs with a bridged or custom network, passed through devices, more than one disk, or a CD other than the first boot one are refused with the reason. Snapshots and restore points stay with the original, and who may open the VM is set again on the new server. A VM with an emulated TPM (virt-install gives one to every UEFI VM) moves, but the keys stored in a TPM do not, so it starts with an empty one, and the finished move says so in warning; that only matters if something inside the VM sealed a secret to its TPM. A VM that uses the server's own TPM is refused. Both servers must be on a version with moves, and should run the same operating system version, so the new server knows the VM's machine type.

Between the servers. These are used by the Fleet server and need an admin API key, except the file download, which needs the transfer token. They are listed so a move can be understood, not to be called by hand. POST /api/v1/vms/{name}/move/prepare (on the server that has the VM: stop it if allowed, make the files, return a transfer token), GET /api/v1/move/{name}/files/{role} (the token is the credential, and it opens only that VM's files until the move ends), POST /api/v1/move/receive (on the new server: fetch the files from the other server, check every one against its checksum, define and start the VM, and answer when it has an address), POST /api/v1/vms/{name}/move/release (finish or undo on the source), POST /api/v1/move/abort and GET /api/v1/move/{name}/status (to settle a move after a lost connection). A VM that is part way through a move cannot be started, snapshotted or restored.

AWS in Fleet

GET /api/v1/fleet/aws Admin

Lists the EC2 instances virtuOSo launched (tagged ManagedBy=virtuoso) in this server's own AWS account, in every region the account can read, and estimates what the running ones cost. It only reads, using ec2:DescribeInstances and ec2:DescribeRegions, which the documented policy already allows. A region the policy does not allow answers "unauthorized" every time, so it is asked about once and then left alone for a day, which keeps unauthorized events from piling up in the account's audit log. Those regions are listed as skipped_regions, not as errors, and a real failure goes in unreadable_regions. read_regions lists the regions that were read. The answer is kept for a minute; add ?refresh=1 to read AWS now. If AWS is not set up the answer is {"configured": false}.

{"configured": true, "loaded": true, "error": "", "refreshed": "just now",
 "totals": {"instances": 3, "running": 2, "stopped": 1, "regions": ["us-east-1", "us-west-2"], "vcpus_running": 4,
            "estimated_hourly_usd": 0.0624, "estimated_monthly_usd": 45.55, "running_without_price": 0},
 "instances": [{"id": "i-0abc", "name": "web", "region": "us-east-1", "type": "t3.small", "state": "running", "vcpus": 2,
                "memory_gib": 2, "public_ip": "203.0.113.5", "private_ip": "192.0.2.5", "launched_at": "2026-11-04T10:00:00Z",
                "estimated_hourly_usd": 0.0208}],
 "read_regions": ["us-east-1", "us-west-2"], "skipped_regions": ["eu-west-1"], "unreadable_regions": [],
 "estimate_note": "On demand Linux prices for us-east-1. Other regions differ, and storage and data transfer are extra."}

The cost is an estimate: on demand Linux prices for us-east-1, for the instance types virtuOSo launches. A stopped instance has an estimate of 0 (only its storage is billed), and a running instance of a type with no price has null and is counted in running_without_price.

Launching on AWS

POST /api/v1/fleet/aws/instances Admin

Launches an EC2 instance in this server's AWS account. It costs money while it runs, so it is refused unless confirm_cost is true; the refusal states the estimated hourly cost and what to set. The same launch is behind the Launch on AWS form on the Launch VM and Fleet Deploy pages, vm fleet aws-launch and the MCP tool launch_aws_instance. It is for admins only, and the AWS form only appears if AWS is set up.

FieldTypeRequiredDescription
namestringYesInstance name, not already in use
confirm_costboolYesMust be true
instance_typestringNot3.micro (default), t3.small, t3.medium, t3.large, t3.xlarge, t3.2xlarge, m5.2xlarge or m5.4xlarge
regionstringNoA region the account can read (GET /api/v1/fleet/aws lists them in read_regions). Defaults to the default region in Settings
osstringNoubuntu-24.04 (default), ubuntu-26.04, ubuntu-22.04 or amazon-2023
disk_gbintNoRoot disk size in GB, 8 to 2000. Left out, the image's own size (8 GB) is used. The disk is billed while the instance exists, about $0.08 per GB a month, and is deleted with it
ttl_hoursintNoTerminate automatically after this many hours: 1, 2, 4, 8, 24, 72 or 168. 0 (default) never terminates it
portsarrayNoExtra ports to open as {"port": 443, "source": "203.0.113.7/32"}; source defaults to 0.0.0.0/0. SSH is always open. At most 10
ssh_key, user_scriptstringNoAn SSH public key to install, and a shell script to run on first boot

Response: 202 with {"name", "password", "status": "creating", "region", "instance_type", "estimated_hourly_usd", "disk_gb", "estimated_storage_monthly_usd", "ttl_hours", "expires_at", "estimated_max_cost_usd"} (the two disk fields only when a disk was set). The instance takes a minute or two to be ready; watch GET /api/v1/fleet/aws. 400 for anything invalid or an unconfirmed cost, 403 for a non admin key, 409 if the name is in use. The estimate uses on demand us-east-1 prices; storage and data transfer are extra.

Terminating. DELETE /api/v1/fleet/aws/instances/{id} terminates an instance that was launched from Fleet and removes the security groups made for it, and returns {"ok": true, "terminated", "name", "region"}. It cannot be undone and the instance's disk is lost. It refuses (404) an instance that was not launched from Fleet, such as one from the Compute app, which must be deleted where it was launched. The AWS table has a Terminate button for the same thing, and the Terraform resource virtuoso_aws_instance uses it on destroy.

Automatic termination. With ttl_hours set, the instance is tagged ExpiresAt, and the running service terminates it when the time passes, checking about once a minute. It acts only on instances it was told about at launch, and only if AWS still shows them as virtuOSo's, and if AWS cannot be read it terminates nothing and tries again. The security groups it made are removed with it. POST /api/v1/fleet/aws/instances/{id}/keep cancels the termination ({"ok": true, "kept": true}; kept is false if there was none). The AWS section of Fleet shows when each instance ends, with Keep, Extend and Terminate buttons. POST /api/v1/fleet/aws/instances/{id}/extend with {"hours": 6, "days": 2, "confirm_cost": true} adds that much time (hours and days are added together, up to 90 days in one call) to the current end, and returns instance_id, name, expires_at, added_hours, hourly_usd and max_added_cost_usd. It keeps the instance running and billed for the added time, so confirm_cost must be true. An instance can be extended as often as you like, and Keep or Terminate still work at any time, including during an extension. An instance that is not set to terminate (it was kept) returns 409, because there is nothing to extend. The service must be running for this to happen.

Fleet on every node

When you add a node to a Fleet server (the hub), the hub tells the node who manages it, and on that node the Fleet button leads to the hub's Fleet page. You see the same view wherever you land. The node learns only the hub's name and address. It never receives any key, so one node being compromised does not give access to the others.

PUT /api/v1/fleet/manager (admin key) takes {"name": "hub-1", "url": "hub.example.test"}. The address follows the same rules as a node address. DELETE /api/v1/fleet/manager clears it; with {"url": "..."} it clears only if that is the current manager, so one hub cannot release a node that another hub manages. GET /api/v1/host reports fleet_manager: {"name", "url"}, with empty values when the server is not managed. A node with no fleet of its own sends its Fleet button to the manager; with its own nodes it shows its own page, and /fleet?local=1 always shows the local page.

The hub needs to know its own address. It saves the address you used to reach it the first time you add a node, and you can change it in Settings > General > Fleet Address. Until it is set, nothing is sent. Every check re-registers a node that points somewhere else, and removing a node from the fleet releases it. A node can detach itself in Settings. Older nodes that do not report a manager are left alone.

Signing in to a node from Fleet

When you click Open, Shell, Console or VNC on a node in Fleet, you arrive already signed in, so you only sign in to the Fleet server. This server asks the node for a ticket with the node's saved admin key, and your browser hands the ticket to the node. Ordinary sign in is unchanged: a person who did not come through Fleet signs in as always. An older node that has no tickets gets a plain link to its own sign in page.

POST /api/v1/sso/tickets (admin key) takes an optional {"next": "/vms/web1/shell"}, which must be a path on the node, and returns 201 with {"ticket", "sso_path": "/sso", "next", "expires_in": 60}. POST /sso with the form field ticket redeems it: it sets a session cookie for the owner of the key and moves on to next. A ticket works once and only within 60 seconds, only an admin can be signed in, and GET /sso is refused so a ticket never sits in an address bar or a log. Only a hash of the ticket is stored. The ticket gives nothing the key does not already allow.

VM Schedules, Snapshots and Restore Points

These endpoints work for on-prem VMs and for AWS instances that virtuOSo launched. A user needs access to the VM, and an admin can manage any VM. A VM the caller cannot access returns 404, the same as one that does not exist. None of these features is on until it is created. The Schedules, Snapshots and Restore Points page explains how each one behaves.

Schedule

PUT /api/v1/vms/{name}/schedule API Key
FieldTypeRequiredDefaultDescription
daysstringNoeverydayeveryday, weekdays, weekends, or a list such as mon,wed,fri
start_atstringOne of the twononeStart time, HH:MM, 24 hour clock
stop_atstringOne of the twononeStop time, HH:MM, 24 hour clock
tzstringNoserver zoneIANA time zone, for example America/New_York
enabledboolNotruefalse keeps the times but turns the schedule off

Set at least one of start_at and stop_at; they cannot be equal. A start or stop that was missed while virtuOSo was down is skipped. Response 200 with the saved schedule, plus the last run when there is one:

{"vm": "dev-box", "days": "weekdays", "start_at": "08:00", "stop_at": "19:00", "tz": "UTC", "enabled": true,
 "last_action": "start", "last_at": "2026-03-02T08:00:03Z"}

GET returns the same object, or 404 if the VM has no schedule. DELETE removes it and returns {"ok": true}. GET /api/v1/schedules (admin) returns {"schedules": [...], "server_timezone": "..."}. Invalid input returns 400 with the reason.

Snapshots

A snapshot is a full copy of a VM's disk. A snapshot of a running VM is crash consistent; of a stopped VM it is clean.

POST /api/v1/vms/{name}/snapshots API Key
FieldTypeRequiredDefaultDescription
namestringNononeA label, up to 80 characters. snapshot_name is accepted too, for clients that already use name for the VM
retention_daysintNo0Days until it is deleted: 1, 3, 5, 7, 14 or 28. 0 keeps it until you delete it

Response 202 Accepted with the snapshot in the creating state. Poll GET /api/v1/vms/{name}/snapshots until its status is ready (or failed, with error).

{"id": "snap-20260301-020000-ab12cd", "vm": "dev-box", "name": "before upgrade", "kind": "full", "source": "manual",
 "status": "ready", "created_at": "2026-03-01T02:00:00Z", "expires_at": "2026-03-08T02:00:00Z", "retention_days": 7,
 "size_bytes": 820576256, "consistency": "crash-consistent"}

source is manual, scheduled (a restore point) or before-restore (the safety copy taken before a restore). The list returns {"snapshots": [...], "estimate": {"needed_bytes": N, "free_bytes": N}}, plus "operation" while one is running. For AWS VMs estimate is replaced by estimate_note, because AWS snapshots use no local space.

EndpointDescription
DELETE /api/v1/vms/{name}/snapshots/{id}Delete a snapshot and its data. {"ok": true}
POST /api/v1/vms/{name}/snapshots/{id}/restoreRestore the VM to the snapshot. Returns 202. The VM is stopped, a safety copy of its current state is saved and kept for 7 days, the disk is replaced, and the VM is started again if it was running. Restore the safety copy to undo
GET /api/v1/snapshotsAdmin. Every snapshot

Errors: 400 invalid retention or name, 404 unknown VM or snapshot, 409 another operation is running on the VM, 422 the VM cannot be snapshotted (for example more than one disk), 507 not enough free disk space (the message says how much is needed). The newest snapshot of a VM is never deleted automatically.

Restore Points

A restore point policy takes a snapshot automatically and deletes each after retention_days.

PUT /api/v1/vms/{name}/restore-policy API Key
FieldTypeRequiredDefaultDescription
atstringYesnoneTime of day, HH:MM, 24 hour clock
retention_daysintYesnone1, 3, 5, 7, 14 or 28. A restore point always expires
daysstringNoeverydaySame values as a schedule
tzstringNoserver zoneIANA time zone
enabledboolNotruefalse keeps the policy but stops taking snapshots

Response 200 with the policy and an estimate of the space it uses once a full retention period has passed:

{"policy": {"vm": "dev-box", "days": "everyday", "at": "02:00", "tz": "UTC", "retention_days": 7, "enabled": true,
            "last_at": "2026-03-02T02:00:03Z", "last_result": "started"},
 "estimate": {"copies": 7, "bytes_per_copy": 820000000, "bytes_total": 5740000000, "free_bytes": 820000000000}}

last_result is started or skipped; a skipped run (short on disk space, or the VM was busy) puts the reason in last_error. GET returns the same, or 404 if there is no policy. DELETE removes it; existing snapshots stay until they expire. GET /api/v1/restore-policies (admin) lists all policies.