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.
https://api.locally.host/v1JSON over HTTPSBearer tokenAuthentication
Create a token under Dashboard → API & Keys. Scopes: read, deploy or full. Send it on every request:
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 https://api.locally.host/v1/servers \ -H "Authorization: Bearer $LOCALLY_TOKEN"
{
"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.
{
"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 -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).
{
"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
| Code | Meaning | What to do |
|---|---|---|
| 401 | Missing or invalid token | Check the Authorization header |
| 402 | Insufficient balance | Top up via /deposits |
| 404 | Resource not found | Verify the id; it may be deleted |
| 409 | Conflicting action | Server busy; retry after current op |
| 429 | Rate limited | Back 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.