SENTINEL

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

  1. The client sends the audit request to POST /api/audits without payment.
  2. 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 sourceHash it priced.
  3. The wallet signs an EIP-3009 TransferWithAuthorization for 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.
  4. The client repeats the request with the signed payload, base64-encoded, in the X-PAYMENT header.
  5. Sentinel checks the signature and amount itself, asks the facilitator at https://x402.org/facilitator to verify it, then to settle it. The facilitator submits the transfer onchain and pays the gas.
  6. Only after settlement is the job created. The response carries the job id and an X-PAYMENT-RESPONSE header 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

TierLinesBase SepoliaMainnet
Quick Scan6000.05 USDC$5
Deep Scan3,0000.25 USDC$25
Full Audit10,0001.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.