Skip to main content
Everything the CLI does is plain HTTP on https://compute.x402layer.cc/backups/*, authenticated with a compute API key (X-API-Key). Encryption always happens on your side — the flow is reserve → presigned PUT of ciphertext → complete. Full endpoint schemas: Agent Vault API reference.

TypeScript — @singularity-layer/grid

Pure-JS envelope (noble crypto) — works in Node and browsers.
backupBytes/restoreBytes handle arbitrary payloads — pack directories with the CLI or Python SDK, or bring your own archive.

Python — singularity-grid

Full directory backup/restore, stdlib scrypt + cryptography AES-GCM:

Paying with x402

POST /backups/subscribe takes credits by default. Add pay: "x402" (and optionally network) and, if a charge is actually required and your credits are short, it answers 402 with a standard x402 challenge:
Networks: base (USDC) · solana (USDC) · robinhood (USDG) · megaeth (USDm). A few deliberate properties worth knowing:
  • The challenge quotes the full plan price. Upgrades are prorated against the time you already paid for, so the actual debit is often lower — whatever the charge doesn’t consume stays in your credit balance.
  • You are never asked to pay for nothing. The subscription decides first, so cancelling (plan: "free"), scheduling a downgrade, or re-picking the plan you are already on returns 200 and never issues a challenge.
  • The payer must be the authenticated wallet. Paying from one wallet to subscribe another is refused.
  • Replays are safe. Settlement is idempotent on the transaction hash, so re-sending the same X-Payment cannot charge you twice.

One envelope, everywhere

CLI, pod runner, TypeScript, and Python all produce the identical encrypted envelope (scrypt N=2^17 r=8 p=1 → AES-256-GCM, snapshot identity bound into the AAD, parsed from the snapshot’s r2Key). A blob encrypted by any of them restores with any other — cross-verified byte-for-byte in CI-style tests.
Zero-knowledge cuts both ways: a lost passphrase is unrecoverable by anyone, including Singularity Layer.

MCP (for agents)

The Singularity MCP (https://mcp.x402layer.cc/mcp, streamable HTTP) ships six vault tools: vault_usage, vault_list_agents, vault_list_snapshots, vault_delete_snapshot, vault_subscribe_pro, and vault_how_to_backup. Management tools take a compute API key per call; creating/restoring the encrypted payload itself stays on the agent’s machine (zero-knowledge), and vault_how_to_backup hands the agent the exact CLI steps. Agent Pods carry this MCP natively — pod agents can check and manage their own backups out of the box.