# vm402 > Instant VMs for your agent — **$0.01/h awake · > $0.0005/h asleep** (x402 USDC on Base), or > 10 sats/h over lightning (L402). No account, no signup, > no captchas. Run anything on it, upload files, host an app, run workflows, > and optionally serve HTTP on a public URL (or expose nothing — it's your > machine). It sleeps when idle and wakes on request, and is billed at two > rates: the full rate for awake time and a flat 0.05× rate while > asleep (keeps the disk) — a fully idle day still costs > ~1.2 credit-hours. When credit runs out compute stops; > the disk survives a grace period (1 day + 1 day per 24 hours ever bought), > then the VM is deleted. There are no accounts and no warnings: keeping a > VM alive is the holder's responsibility — poll GET /vms/{id}/meter > (public, no token) and top up before the balance hits 0. Pay with > lightning (L402) or natively with USDC on Base (x402); other rails > (x402 on Solana, MPP) work via the l402.space proxy. Host an app on it, > or just work in it. For exact endpoints, auth, request/response shapes, and worked examples, use the docs below — don't infer the API from this file. Paying the 402 is best driven by an agentic wallet that settles L402 invoices automatically — raw curl can't complete the payment. ## Hosting a server? Read this first Processes started via `POST /vms/{id}/exec` die the moment the command returns — never launch a server with `&`. Register it as a **managed service** instead: PUT /vms/{id}/services/{name} {"cmd": "node", "args": ["server.js"], "dir": "/app", "http_port": 8080} Set `http_port` to the port your server listens on — the VM's public URL routes to it and auto-starts the service on request (one service can hold `http_port` at a time). Services restart across sleep/wake automatically: the VM sleeps when idle and wakes on the next request in under a second, so your public URL stays live the whole time. Make the URL public with `PATCH /vms/{id}/url`. Full walkthrough: [https://vm402.com/docs](https://vm402.com/docs). ## Custom subdomain (paid alias) The default URL is `https://{id}.vm402.com` (random 8-hex id). A nicer name costs a flat **$0.20 / 200 sats** each, same 402 payment flow: POST /vms/{id}/aliases {"name": "myapp"} → `https://myapp.vm402.com` serves the same app as the VM URL. First come first served; buy as many as you want; the alias is deleted with the VM (and the name frees up) — keep the VM's meter topped up to keep its names. List/remove with the VM token: `GET /vms/{id}/aliases`, `DELETE /vms/{id}/aliases/{name}`. ## Docs - [Overview](https://vm402.com/): what it is, at a glance - [Guide](https://vm402.com/docs): worked sessions (run code, host an app) and gotchas - [API reference](https://vm402.com/api-docs): every endpoint, with example calls - [OpenAPI](https://vm402.com/openapi.json): machine-readable spec ## Contact - Abuse: abuse@vm402.com