Rent a Mac computer with x402.
x402 checkout is not enabled in this environment yet. The API returns 404 until X402_ENABLED is set; the examples below describe the testnet API.
1. Request an allocation
Send JSON with a machine, a term and the agent's SSH public key. Without payment, the API answers 402 Payment Required.
curl -i -X POST https://tuumest.net/v1/allocations \
-H 'content-type: application/json' \
-d "{\"machine\":\"studio-max\",\"term_months\":1,\"ssh_public_key\":\"$(cat ~/.ssh/id_ed25519.pub)\"}"2. Read the quote
The PAYMENT-REQUIRED header is base64 JSON. It asks for the first month only.On testnet this is scaled down 1000×: 0.499 test USDC (499000 base units).
Testnet: prices are scaled down 1000× (0.499 test USDC).
PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6MiwicmVzb3VyY2UiOnsidXJsIjoiaHR0cHM6Ly90dXVtZXN0Lm5ldC92MS9hbGxvY2F0aW9ucyIsImRlc2NyaXB0aW9uIjoiTWFjIFN0dWRpbyB3aXRoIE01IE1heCAoNjQgR0IpOiBmaXJzdCBtb250aCBvZiBhIDEtbW9udGggdGVybS4gVGVzdG5ldDogcHJpY2VzIGFyZSBzY2FsZWQgZG93biAxMDAww5cgKDAuNDk5IHRlc3QgVVNEQykiLCJtaW1lVHlwZSI6ImFwcGxpY2F0aW9uL2pzb24ifSwiYWNjZXB0cyI6W3sic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoiZWlwMTU1Ojg0NTMyIiwiYW1vdW50IjoiNDk5MDAwIiwiYXNzZXQiOiIweDAzNkNiRDUzODQyYzU0MjY2MzRlNzkyOTU0MWVDMjMxOGYzZENGN2UiLCJwYXlUbyI6IjB4ZTIzYjVhMTgzMmNiZDAwNzNmYjcyMzRhZjVmMDg0ZjQyZTg4NTg1ZSIsIm1heFRpbWVvdXRTZWNvbmRzIjoxMjAsImV4dHJhIjp7Im5hbWUiOiJVU0RDIiwidmVyc2lvbiI6IjIifX1dfQ=={
"x402Version": 2,
"resource": {
"url": "https://tuumest.net/v1/allocations",
"description": "Mac Studio with M5 Max (64 GB): first month of a 1-month term. Testnet: prices are scaled down 1000× (0.499 test USDC)",
"mimeType": "application/json"
},
"accepts": [
{
"scheme": "exact",
"network": "eip155:84532",
"amount": "499000",
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"payTo": "0xe23b5a1832cbd0073fb7234af5f084f42e88585e",
"maxTimeoutSeconds": 120,
"extra": {
"name": "USDC",
"version": "2"
}
}
]
}- Network
- eip155:84532 (Base Sepolia)
- Asset
- 0x036CbD53842c5426634e7929541eC2318f3dCF7e
- Pay to
- 0xe23b5a1832cbd0073fb7234af5f084f42e88585e
- Timeout
- 120 seconds
3. Sign and retry
Use an x402 client or sign an EIP-3009 USDC transfer authorization, then retry the same request with a PAYMENT-SIGNATURE header. The payload in accepted must match the quote.
PAYMENT-SIGNATURE: eyJ4NDAyVmVyc2lvbiI6MiwicmVzb3VyY2UiOnsidXJsIjoiaHR0cHM6Ly90dXVtZXN0Lm5ldC92MS9hbGxvY2F0aW9ucyIsImRlc2NyaXB0aW9uIjoiTWFjIFN0dWRpbyB3aXRoIE01IE1heCAoNjQgR0IpOiBmaXJzdCBtb250aCBvZiBhIDEtbW9udGggdGVybS4gVGVzdG5ldDogcHJpY2VzIGFyZSBzY2FsZWQgZG93biAxMDAww5cgKDAuNDk5IHRlc3QgVVNEQykiLCJtaW1lVHlwZSI6ImFwcGxpY2F0aW9uL2pzb24ifSwiYWNjZXB0ZWQiOnsic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoiZWlwMTU1Ojg0NTMyIiwiYW1vdW50IjoiNDk5MDAwIiwiYXNzZXQiOiIweDAzNkNiRDUzODQyYzU0MjY2MzRlNzkyOTU0MWVDMjMxOGYzZENGN2UiLCJwYXlUbyI6IjB4ZTIzYjVhMTgzMmNiZDAwNzNmYjcyMzRhZjVmMDg0ZjQyZTg4NTg1ZSIsIm1heFRpbWVvdXRTZWNvbmRzIjoxMjAsImV4dHJhIjp7Im5hbWUiOiJVU0RDIiwidmVyc2lvbiI6IjIifX0sInBheWxvYWQiOnsic2lnbmF0dXJlIjoiMHjigKZkZW1vLXNpZ25hdHVyZSIsImF1dGhvcml6YXRpb24iOnsiZnJvbSI6IjB44oCmYWdlbnQtd2FsbGV0IiwidG8iOiIweGUyM2I1YTE4MzJjYmQwMDczZmI3MjM0YWY1ZjA4NGY0MmU4ODU4NWUiLCJ2YWx1ZSI6IjQ5OTAwMCIsInZhbGlkQWZ0ZXIiOiIwIiwidmFsaWRCZWZvcmUiOiIxNzk1MzE3NDMwIiwibm9uY2UiOiIweOKApjMyLWJ5dGUtbm9uY2UifX19The sample signature is not valid; use a funded test wallet and a real x402 client.
4. Receive the allocation
A successful payment returns 202 Accepted with a one-time access token. Only its hash is stored; keep the token secret.
PAYMENT-RESPONSE: eyJzdWNjZXNzIjp0cnVlLCJ0cmFuc2FjdGlvbiI6IjB44oCmdHJhbnNhY3Rpb24iLCJuZXR3b3JrIjoiZWlwMTU1Ojg0NTMyIiwicGF5ZXIiOiIweOKApmFnZW50LXdhbGxldCIsImFtb3VudCI6IjQ5OTAwMCJ9{
"allocation_id": "<uuid>",
"status": "paid",
"status_url": "https://tuumest.net/v1/allocations/<uuid>",
"access_token": "<shown once>",
"sandbox": true
}Poll the status URL with the token:
curl https://tuumest.net/v1/allocations/<uuid> \
-H 'authorization: Bearer <access_token>'On testnet the allocation becomes active after about 30 seconds. SSH is agent@sandbox.tuumest.net. No physical machine is provisioned and no ops task is created. If the response instead says pending_settlement, keep polling the returned status_url; do not pay again.
Settlement is confirmed only after the transaction is canonical and final on Base, so a confirmed facilitator response can still be pending_settlement for a short while. Replaying the same signed payment always returns the original operation, even after the authorization's validBefore; an expired authorization never turns an in-flight payment into a new quote. If the operation status becomes needs_review, ops has already been alerted: stop and contact support instead of signing a new payment.
Lost the token?
Request a one-time challenge at POST /v1/allocations/:id/token/challenge. Sign the returned message with the paying wallet using personal_sign, then post the message and signature to POST /v1/allocations/:id/token. Challenges expire after five minutes and are consumed once. The old token is invalidated and the same signature cannot be replayed.
TypeScript client
The TypeScript client works with this endpoint. The SDK's default spending cap is $1, so raise it explicitly above the most expensive month ($749).
npm i @x402/core @x402/evm viem
import { x402Client } from '@x402/core/client';
import { x402HTTPClient } from '@x402/core/http';
import { ExactEvmScheme } from '@x402/evm/exact/client';
import { privateKeyToAccount } from 'viem/accounts';
const signer = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const core = x402Client.fromConfig({
schemes: [{ network: 'eip155:84532', client: new ExactEvmScheme(signer) }],
spendControls: { maxAmountPerPayment: '$800' },
});
const client = new x402HTTPClient(core);Use a dedicated test wallet. Never put a mainnet key in an agent that reads untrusted pages.
Testnet semantics
- Use Base Sepolia test USDC; it has no real value.
- The pay-to address is a placeholder until the founders confirm the receiving wallet.
- Do not treat a sandbox allocation as a real machine or a production promise.
- Mainnet requires a real
X402_PAY_TO, a mainnet facilitator and a deliberate config change.
API index: /v1