Documentation

LiteVPS — Platform Guide

LiteVPS gives AI agents and developers on-demand KVM virtual machines they can control directly via REST API. This page covers the concepts, quick-start, and links to the full API reference.

On this page

Concepts

VPS (Virtual Private Server) — a KVM virtual machine with its own guest OS, allocated CPU, RAM, and disk. Each VM gets a private IP and outbound internet access. VMs are managed through the REST API or web portal.

Plans — fixed-spec tiers that define vCPU, RAM, disk, and price. Select a current plan when creating the VM. See Pricing for the live plan table.

Templates — the current catalog of provisionable operating-system images. Fetch GET /api/templates and provide one returned slug during creation.

Managed execution — the /exec endpoint runs commands through a platform-managed connection to the guest. Your controller uses HTTP and does not hold the platform's guest-access key.

Quick start

Four REST calls get you from zero to running code inside a VM:

Step 1 — Authenticate
POST https://api.litevps.dev/api/auth/login
{ "email": "you@example.com", "password": "..." }
← { "token": "eyJ..." }

The returned JWT is valid for 30 days. Pass it as Authorization: Bearer <token> on all subsequent requests. You can also generate long-lived API tokens in the portal under API Tokens.

Step 2 — Pick a plan and OS template
GET https://api.litevps.dev/api/pricing
← { "plans": [{ "id": "...", "name": "Lite1", "vcpu": 1, ... }] }

GET https://api.litevps.dev/api/templates
Authorization: Bearer eyJ...
← [{ "slug": "...", "name": "...", ... }]

Pricing is public; templates require authentication. Copy a current plan id and template slug for step 3.

Step 3 — Create a VM
POST https://api.litevps.dev/api/vps
Authorization: Bearer eyJ...
{ "name": "my-task", "plan_id": "<plan id>", "template": "<template slug>" }
← { "vps": { "id": "d4e1...", "state": "running", "ready": false } }

Creation returns after the VM domain starts. Poll GET /api/vps/:id until vps.ready is true before calling /exec.

Step 4 — Run code, then destroy
POST https://api.litevps.dev/api/vps/d4e1.../exec
{ "command": "python3 -c 'print(2+2)'" }
← { "stdout": "4\n", "exit_code": 0, "duration_ms": 312 }

DELETE https://api.litevps.dev/api/vps/d4e1...
← 200 { "message": "VPS deleted" }  (billing stops, resources released)

Running commands with /exec

POST /api/vps/:id/exec runs a shell command inside the VM and returns its output synchronously. Commands run as root by default. Your controller does not need to manage a direct SSH connection or expose a new port for this request.

Request body:

{
  "command": "apt-get install -y python3 && python3 script.py",
  "timeout_seconds": 120   // optional, default 30
}

Response:

{
  "stdout": "result: 42\n",
  "stderr": "",
  "exit_code": 0,
  "duration_ms": 1823
}

Commands run in a bash shell. You can chain commands with &&, pipe output, install packages, download files, write to disk — everything a normal root shell supports. State persists across exec calls within the same VM's lifetime.

Billing

Usage is metered per minute. Every minute a VM exists in running or stopped state, one minute of time is charged at the plan's hourly rate ÷ 60. A stopped VM still holds its disk allocation and a reserved slot on the host, so charges continue. Destroy the VM to stop billing entirely. Daily usage is rolled up into a single ledger entry so your billing history stays clean.

The monthly price shown on the Pricing page is the usage cap applied within a calendar month. Short-lived workloads cost proportionally less.

Accounts use a prepaid balance. Top up via credit card from the Billing page. Enable Auto top-up to automatically recharge when your balance falls below a threshold — useful for long-running agents.

Check your current balance and transaction history at any time via GET /api/billing/balance and GET /api/billing/history.

Network & connectivity

Each VM gets a private IP address in the customer_ip field. Do not assume account-scoped private connectivity between VMs; use documented inbound mappings for services that must communicate.

Outbound internet access is included on all plans — your VMs can reach external APIs, download packages, clone repos, etc.

Inbound SSH is available on every VM via a dedicated port on the host's public IP. The port is shown in your portal dashboard (ssh_port field). Connect with: ssh -p <ssh_port> root@<host_ip>.

Inbound HTTP/HTTPS is available through the managed endpoint identified by the VM's proxy_subdomain field. VMs do not receive a dedicated public IPv4; inbound access uses managed SSH port mapping or HTTP/HTTPS proxying.

Snapshots

Snapshots capture the full disk state of a running VM. Use them to:

  • Checkpoint an agent's environment mid-task and restore it after a failure.
  • Retry work on the same VM from a known disk state.
  • Preserve a configured environment so you don't have to re-install dependencies each run.

Manage snapshots via POST /api/vps/:id/snapshots, GET /api/vps/:id/snapshots, and POST /api/vps/:id/snapshots/:name/restore. See the API reference for full details.

API reference

The full API reference documents every endpoint with request/response schemas, examples, and error codes. It is designed to be read by both humans and language models.

View full API reference →