Paying with x402
Sentinel charges per audit with x402, version 1, exact scheme, on Base Sepolia in Circle test USDC (0x036CbD53842c5426634e7929541eC2318f3dCF7e, 6 decimals). There is no account and no subscription, and the payer pays no gas.
The exchange
- The client sends the audit request to
POST /api/auditswithout payment. - Sentinel ingests the code, counts the lines and answers 402 Payment Required with one payment requirement: the tier price in USDC atoms, the treasury address, a five-minute validity, and the
sourceHashit priced. - The wallet signs an EIP-3009
TransferWithAuthorizationfor exactly that amount to that address, as EIP-712 data in the USDC domain (name: "USDC",version: "2"). Signing is free and moves nothing yet. - The client repeats the request with the signed payload, base64-encoded, in the
X-PAYMENTheader. - Sentinel checks the signature and amount itself, asks the facilitator at
https://x402.org/facilitatorto verify it, then to settle it. The facilitator submits the transfer onchain and pays the gas. - Only after settlement is the job created. The response carries the job id and an
X-PAYMENT-RESPONSEheader with the settlement transaction hash, which is also stored with the job.
POST /api/audits
content-type: application/json
{ "tier": "quick", "input": { "kind": "address", "chainId": 84532, "address": "0x…" } }
HTTP/1.1 402 Payment Required
{ "x402Version": 1, "error": "X-PAYMENT header is required",
"accepts": [{ "scheme": "exact", "network": "base-sepolia",
"maxAmountRequired": "50000", "asset": "0x036C…",
"payTo": "0x…", "maxTimeoutSeconds": 300,
"extra": { "name": "USDC", "version": "2", "sourceHash": "0x…" } }] }
Any x402 v1 client works, including agents. The payment is bound to the input: if the code changes between the 402 and the paid request, the price is recomputed from the new code.
Prices
| Tier | Lines | Base Sepolia | Mainnet |
|---|---|---|---|
| Quick Scan | 600 | 0.05 USDC | $5 |
| Deep Scan | 3,000 | 0.25 USDC | $25 |
| Full Audit | 10,000 | 1.00 USDC | $100 |
Get test USDC from the Circle faucet (choose Base Sepolia).
When something fails
- A refused payment (expired, wrong amount, insufficient balance) returns 402 again with a reason, and nothing is charged.
- If the audit fails after the payment settled, the job is marked failed with the stage and the error, and keeps the payment transaction. Refunds are manual in v0.1: send the job id to the operator. Transient failures (a model or RPC outage) are retried up to three times first, and a report that was produced is never re-billed if only the onchain write failed.