VPS & GPU API for developers & AI agents

Everything on NanVPS can be done over a small REST API. There is no API key or account: an order is accessed with the secret token returned when it is created. Durations are in hours (hours, periodHours), from 1 hour; a VPS also accepts days.

Base URL: https://api.nanvps.com · OpenAPI spec · llms.txt

1. Choose a server

curl "https://api.nanvps.com/catalog"            # vps.plans[] {id, vcpu, ramMb, diskGb, regions[], prices{hours}}, vps.regions[], vps.os[], gpu.groups[]
curl "https://api.nanvps.com/gpu/offers?group=1x-rtx-4090"   # live GPU offers {id, location, maxHours, pricePerHourUsd{diskGb}}

A VPS price can differ per region: use regionPrices[region] when present, else prices. A GPU costs max(minPriceUsd, hours × pricePerHourUsd[disk]), rounded up to the cent. GET /price returns the exact amount.

2. Order

# cloud VPS: 30 days (720 hours) in Amsterdam, Ubuntu (os id from vps.os), optional SSH key
curl -X POST "https://api.nanvps.com/buy" -H "Content-Type: application/json" \
  -d '{"type":"vps","plan":"vc2-1c-1gb","region":"ams","os":2284,"hours":720,"sshKey":"ssh-ed25519 AAAA...","payinCurrency":"XNO"}'

# GPU server: 24 hours on offer 12345, 50 GB disk, PyTorch image
curl -X POST "https://api.nanvps.com/buy" -H "Content-Type: application/json" \
  -d '{"type":"gpu","offer":12345,"hours":24,"disk":50,"image":"pytorch","payinCurrency":"XNO"}'

The response contains token (shown only once, store it), priceUsd, payment with payinAddress, payinAmount, payinCurrency and paymentLink, and balanceToken when a balance was created for this order: refunds land there.

3. Pay

Send exactly payinAmount of payinCurrency to payinAddress before expireAt, or open paymentLink. XNO and NANUSD confirm in seconds; "payinCurrency":"BALANCE" with a funded balanceToken is instant.

4. Connect

curl "https://api.nanvps.com/order" -H "Authorization: Bearer nx_..."   # wait for server.state "running"

server has ip, sshCommand and, for a VPS, password (root), ipv6 and console (browser console); for a GPU, jupyterUrl and sshProxyCommand. Power actions: POST /order/action with {"action":"reboot"} (start and stop on a VPS).

5. Add time

curl -X POST "https://api.nanvps.com/extend" \
  -H "Authorization: Bearer nx_..." -H "Content-Type: application/json" \
  -d '{"hours":720,"payinCurrency":"XNO"}'      # VPS or GPU, VPS also takes {"days":30}

Prices are in extend.prices of GET /order. Time is added to expiresAt. Servers (VPS and GPU) are deleted with their data at expiresAt: extend before. Nothing renews automatically.

Errors & limits

Errors return {"error": "message"} with status 400 (invalid input, or a GPU offer that is gone), 401 (bad token), 402 (balance too low), 409 (order not active), 429 (too many orders), 502 or 503. If a paid server can't be delivered, the order becomes refunded and the price is credited to its balance.