# Agentgates Compute — buy a confidential VM with USDC (x402)

Buy a dedicated confidential VM (Intel TDX) by the hour and run your Docker
workload on it. No signup and no API key: the wallet that pays owns the
deployment. Every machine carries a remote-attestation quote.

## Endpoints (all on https://agentgates.ai)

- `GET /api/compute/docs` — the full contract and live prices. Read this first; prices move with gas and are never cached here.
- `GET /api/compute/catalog` — plans and prices, machine-readable JSON.
- `POST /api/compute/deployments` — buy. Body: `{"plan","hours","compose"|"image","env","name"}`.
- `GET /api/compute/deployments/{id}` — read state; `endpoint` and `attestation` appear when `status` is `running`.

## The x402 loop

1. Send the POST with no `X-PAYMENT` header. The answer is `402` with an
   `accepts` array — each entry is ONE network's own offer with its exact
   `maxAmountRequired` in USDC atomic units, the `asset` contract and the
   `payTo` address. Quoting is free and repeatable; nothing is charged.
2. Sign that entry's amount as an EIP-3009 TransferWithAuthorization
   (EIP-712 domain in the entry's `extra`).
3. Retry the SAME request with the signature in `X-PAYMENT`
   (base64 of the x402 payload). Settlement confirms on-chain, then the
   machine provisions; the billed clock starts at `running`, not at payment.

## Rules that keep you safe

- Read the price from the 402 you are answering, never from a cached quote.
- Your compose must publish a port — a machine that publishes nothing runs
  and bills with no way to reach it.
- Env values are sealed to the enclave and never stored; keep secrets
  re-settable.
