Black Cat VPN implements x402 v2. An agent asks for a subscription, gets 402 Payment Required with machine-readable terms, signs a USDC transfer on Solana, and sends the same request again. The VPN subscription comes back in that response. No account, no API key, no polling.
$3/month, 5 devices, all three protocols, all locations, unlimited traffic.
OpenAPI spec → Developer guide →One to get the terms, one to pay. The second answer carries the subscription URL.
The server is the fee payer. It co-signs and pays the network fee, so the wallet needs only USDC.
No signup step to automate around. The subscription URL is the access.
A per-user tunnel with VLESS-Reality, Hysteria2 and AmneziaWG. Run a standard client on the config.
Version 2, exact scheme, network solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, asset USDC. Plans are standard-1m, standard-3m, standard-6m and standard-12m.
POST /api/x402/subscribe with a planId and no payment header.accepts[0] gives the amount, recipient, fee payer and memo.PAYMENT-SIGNATURE header.subscriptionUrl from the answer. The PAYMENT-RECEIPT header holds the settled transaction.# 1) ask: the answer is 402 with the payment terms curl -s -X POST https://blackcat.is/api/x402/subscribe \ -H 'content-type: application/json' \ -d '{"planId":"standard-1m"}' # { "x402Version":2, "accepts":[{ "scheme":"exact", "amount":"3000000", "asset":"EPjF…", "payTo":"…", # "maxTimeoutSeconds":120, "extra":{ "feePayer":"…", "memo":"<invoice id>" } }] }
// 2) build and sign, in this instruction order (TypeScript, @solana/web3.js + @solana/spl-token) const req = required.accepts[0], mint = new PublicKey(req.asset); const message = new TransactionMessage({ payerKey: new PublicKey(req.extra.feePayer), // the server pays the network fee recentBlockhash: blockhash, instructions: [ ComputeBudgetProgram.setComputeUnitLimit({ units: 200_000 }), ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1000 }), createTransferCheckedInstruction( getAssociatedTokenAddressSync(mint, payer.publicKey, true), mint, getAssociatedTokenAddressSync(mint, new PublicKey(req.payTo), true), payer.publicKey, BigInt(req.amount), 6), new TransactionInstruction({ keys: [], programId: MEMO_PROGRAM, data: Buffer.from(req.extra.memo) }), ], }).compileToV0Message(); const tx = new VersionedTransaction(message); tx.sign([payer]); // the fee payer's slot stays empty // 3) retry the same request with the payment const paid = { x402Version: 2, resource: required.resource, accepted: req, payload: { transaction: Buffer.from(tx.serialize()).toString("base64") }, extensions: {} }; const res = await fetch(url, { method: "POST", headers: { "content-type": "application/json", "PAYMENT-SIGNATURE": Buffer.from(JSON.stringify(paid)).toString("base64") }, body: JSON.stringify({ planId: "standard-1m" }) }); // 200 → { status, transaction, username, subscriptionUrl }
202 means the payment settled and the subscription is still being issued: poll GET /api/invoices/{invoiceId}. A 409 means the invoice was already used or has expired, so ask for a new one.