# vm402 VM Topup

> vm402 VM Topup is a paid API for AI agents from vm402.com, paid per call via x402, $0.24/call, status unknown (last checked 2026-10-06).

Adds paid runtime hours to an existing anonymous metered VM, extending its active lifetime

## Facts

- Endpoint: POST https://vm402.com/vms/%7Bid%7D/topup?utm_source=zero.xyz
- Price: $0.24/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-06
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/vm402-vm-topup-63d32d28
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_l0ESmfqpZBf8An6qE6KLQ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability vm402-vm-topup-63d32d28 -d '<json body>'
```

Example prompt: Top up my vm402 VM (ID: abc123) with 10 more hours so it keeps running — pay with USDC on Base.

## When to prefer this

Use this endpoint when you already have a running vm402 VM (identified by its bearer token and ID) and need to extend its lifetime before it parks or expires. This is the correct endpoint for adding hours to an existing VM — not for creating a new one. Choose this over cloud provider APIs when you need fully anonymous, account-free compute paid via micropayments (Lightning sats or USDC on Base).

## Known failure modes

- Payment not provided — server returns HTTP 402 with both a Lightning invoice and an x402 USDC challenge; caller must pay and retry with the appropriate authorization header
- Invalid or expired VM ID — VM not found or already terminated
- Malformed payment proof — incorrect preimage for L402 or invalid payment signature for x402
- Insufficient payment — hours requested × rate does not match payment amount
- Network or provider error causing 5xx response

## How this service works

Anonymous metered cloud VPS (Linux VMs) — deploy an app, host a server, or run sandboxed code. You get a VM and can do what you want. No accounts; a bearer token per VM. Create and topup are paid over L402 (lightning) at 10 sats/hour, or natively over x402 (USDC on Base) at $0.01/hour. Call with no payment to get a 402 carrying both challenges: pay the lightning invoice and retry with "Authorization: L402 <token>:<preimage>", or sign the x402 exact-scheme USDC payment and retry with it base64-encoded in the "payment-signature" header. For x402 on other networks or MPP, route the request through https://l402.space/<rail>/<url-encoded-endpoint>.

## Output

Returns the VM's updated status (active or parked), the new expiry timestamp, remaining seconds of runtime, and a receipt object containing the number of hours purchased, the payment scheme used (e.g. l402 or x402), and the timestamp payment was processed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "hours": {
   "type": "number",
   "description": "Hours to add; price is hours × rate"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "allOf": [
  {
   "type": "object",
   "properties": {
    "id": {
     "type": "string"
    },
    "topup": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string"
      },
      "note": {
       "type": "string"
      }
     }
    },
    "status": {
     "enum": [
      "active",
      "parked"
     ],
     "type": "string"
    },
    "expires_at": {
     "type": "string",
     "format": "date-time"
    },
    "remaining_seconds": {
     "type": "integer"
    }
   }
  },
  {
   "type": "object",
   "properties": {
    "receipt": {
     "type": "object",
     "properties": {
      "hours": {
       "type": "number"
      },
      "scheme": {
       "type": "string"
      },
      "paid_at": {
       "type": "string",
       "format": "date-time"
      }
     }
    }
   }
  }
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/vm402-vm-topup-63d32d28/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from vm402.com](https://www.zero.xyz/host/vm402.com/llms.txt)
