NEW

GPU instances are live. Use code LOCAL10 for 10% off your first month.

Deploy now

Locally API

Everything you can do in the dashboard, you can do over HTTPS. Deploy servers, reboot them, take snapshots and pay invoices from scripts, CI pipelines or your own panel.

Base URLhttps://api.locally.host/v1
FormatJSON over HTTPS
AuthBearer token

Authentication

Create a token under Dashboard → API & Keys. Scopes: read, deploy or full. Send it on every request:

curl
curl https://api.locally.host/v1/me \
  -H "Authorization: Bearer lcl_your_token_here"

Tokens are shown once at creation. Treat them like passwords; revoke instantly from the dashboard.

GET /servers

Returns every server on your account.

curl
curl https://api.locally.host/v1/servers \
  -H "Authorization: Bearer $LOCALLY_TOKEN"
200 response
{
  "data": [
    {
      "id": "srv_9f2ka81m",
      "hostname": "gpu-01",
      "plan": "gpu-rtx-4090",
      "region": "fra",
      "os": "ubuntu-24.04",
      "ip": "203.0.113.14",
      "status": "active",
      "expires_at": "2026-08-21T00:00:00Z"
    }
  ]
}

GET /servers/{id}

Full detail for one server, including live metrics.

200 response
{
  "id": "srv_9f2ka81m",
  "hostname": "gpu-01",
  "metrics": {
    "cpu_pct": 34,
    "gpu_pct": 87,
    "vram_used_gb": 19.2,
    "net_mbps": 412,
    "uptime_days": 34
  }
}

POST /servers

Deploys a new server. Requires the deploy scope and enough account balance, or an attached payment method.

curl
curl -X POST https://api.locally.host/v1/servers \
  -H "Authorization: Bearer $LOCALLY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "plan": "gpu-rtx-4090",
    "region": "fra",
    "os": "ubuntu-24.04",
    "template": "ollama",
    "hostname": "my-llm-box",
    "ssh_key_ids": ["key_8an2f"]
  }'

VPS and RDP provision in under 5 minutes; GPU nodes in up to 24 hours. Poll the server or use the server.ready webhook.

POST /servers/{id}/power

Body: {"action": "reboot" | "stop" | "start" | "rescue"}. Rescue boots a recovery image with your disk attached.

POST /servers/{id}/snapshots

Creates a snapshot without stopping the server. List with GET /servers/{id}/snapshots, restore with POST /snapshots/{id}/restore.

GET /invoices

Returns invoices with status paid, unpaid or cancelled. Pay one from balance with POST /invoices/{id}/pay.

POST /deposits

Body: {"amount": 50, "method": "usdt"}. Returns a payment URL (crypto address or checkout link). Balance never expires and deposits are non-refundable.

Webhooks

Register an endpoint in the dashboard and we sign every delivery with X-Locally-Signature (HMAC-SHA256).

server.ready payload
{
  "event": "server.ready",
  "created_at": "2026-08-12T18:04:11Z",
  "data": { "id": "srv_9f2ka81m", "ip": "203.0.113.14" }
}

Events: server.ready, server.expiring, invoice.created, invoice.paid, deposit.confirmed.

Errors

CodeMeaningWhat to do
401Missing or invalid tokenCheck the Authorization header
402Insufficient balanceTop up via /deposits
404Resource not foundVerify the id; it may be deleted
409Conflicting actionServer busy; retry after current op
429Rate limitedBack off per Retry-After header

Rate limits

120 requests per minute per token. Deploy endpoints: 10 per minute. Every response includes X-RateLimit-Remaining. Need more for a panel or reseller integration? Talk to us.