API reference

Prepaid cloud VPS. Authenticated routes use NIP-98 unless using an API key.

Authentication

Sign a kind 27235 event with tags u (exact request URL) and method (HTTP verb). Event must be < 60s old. Send:

Authorization: Nostr <base64(JSON event)>

Autopay: add tag ["debit", "ndebit1…"] on pay and topup requests (not create).

Long-lived agents: POST /v1/auth/api-keyX-Api-Key: ndk_…. API keys cannot attach ndebit.

Customer agent skill

Autonomous agents should fetch and follow:

GET /agent-skill.md

Response envelope

{ "data": { … } }
{ "error": { "code": "…", "message": "…" } }

Public endpoints

MethodPathDescription
GET/v1/healthHealth check
GET/v1/configmarkup_percent, payments_enabled, vapid_public_key
GET/v1/plansCatalog by product line + config_options
GET/v1/ratesBTC/USD spot
POST/v1/orders/quoteLive quote → retail_usd + amount_sats

config_options keys

Keys are option_id strings from the catalog (not names like ram). Example shape after reading GET /v1/plans:

{
  "plan_id": "uuid-from-catalog",
  "pricing_id": 123,
  "hostname": "mybox.example.net",
  "ssh_key": "ssh-ed25519 AAAA…",
  "config_options": { "42": "32768", "43": "8", "45": "debian13-cloud" }
}

Orders

MethodPathDescription
POST/v1/ordersCreate → pending_payment (no invoice yet)
POST/v1/orders/:id/payGet bolt11 or ndebit pull
POST/v1/orders/:id/cancelCancel unpaid order
GET/v1/ordersList orders
GET/v1/orders/:idStatus, progress, vm, payment

VMs

MethodPathDescription
GET/v1/vmsList + ssh_hint, manage
GET/v1/vms/:idVM detail
GET/v1/vms/:id/credentialsRoot password when no SSH key
POST/v1/vms/:id/upgrade/previewPrice resource change
PATCH/v1/vms/:id/upgradeApply resource change
PATCH/v1/vms/:id/startPower on
PATCH/v1/vms/:id/stopPower off
PATCH/v1/vms/:id/restartRestart
PATCH/v1/vms/:id/reinstallReinstall OS
POST/v1/vms/:id/ssh-keyAdd SSH key live
POST/v1/vms/:id/cancelCancel VM

Account

MethodPathDescription
GET/v1/customers/meProfile + balance_usd
PUT/v1/customers/me/autopaySave ndebit pointer
POST/v1/customers/me/topupWallet topup (bolt11 or paid: true)
POST/v1/auth/api-keyMint API key
POST/v1/push/subscribeWeb push (browser)

Order status flow

pending_payment → confirmed → provisioning → ready

Terminal: failed (read user_error) · canceled

Agent polling

  1. GET /v1/plans — pick live plan + option IDs
  2. POST /v1/orders with NIP-98 → pending_payment
  3. POST /v1/orders/:id/pay — pay bolt11 or ndebit
  4. Poll GET /v1/orders/:id every 2–3s until ready or failed
  5. Connect via vm.ssh_hint, or GET /v1/vms/:id/credentials if password login