How it works
Pay-per-use verification over x402 — Base mainnet
Each Cybercentry service is a fixed-price API — see each service's listed price. Instead of accounts or API keys, you pay per call with x402 — an HTTP-native payment handshake. AI agents can discover the catalog via /openapi.json and invoke any service by POSTing JSON, paying automatically with x402.
What's here
The explorer: search and browse every service with its price, category, and chain.
Machine-readable discovery doc (OpenAPI + x-payment-info) so AI agents and x402scan can find and invoke the paid services.
One x402-gated endpoint per service — POST JSON (the canonical call method; GET with query params also works), priced at its catalog value. Returns the deliverable.
A demo page guarded by Next.js middleware (proxy.ts) — browsers see a paywall and pay with a connected wallet.
The payment flow
- 1Pick a service & submit
On the storefront, fill a service's inputs and hit Pay (or call /api/services/<service> directly). No payment is attached yet.
- 2Server responds 402
The server replies 402 Payment Required with a PAYMENT-REQUIRED header describing what it accepts: scheme "exact", network Base, the service's price in USDC, and the address to pay.
- 3Client signs a payment
The wallet builds an "exact" payment authorization and signs it (no on-chain tx yet), then retries the request with a PAYMENT-SIGNATURE header.
- 4Facilitator verifies & settles
The server forwards the payment to the facilitator, which verifies the signature and settles the transfer on Base. No private keys live on this server.
- 5Deliverable is returned
On success the server returns the service's deliverable (200) plus a PAYMENT-RESPONSE header with the settlement details (transaction hash, payer, amount).
Try it yourself
- Get USDC (and a little ETH) on Base in your wallet.
- Open the explorer, pick a service, fill its inputs, and hit Pay.
- Or call an endpoint directly — without payment you get a 402:
curl -i -X POST "https://centry.cybercentry.co.uk/api/services/wallet_verification" \
-H "Content-Type: application/json" \
-d '{"wallet_address":"0x..."}'POST JSON is the canonical call method; GET with query params also works.
Headers in play
PAYMENT-REQUIRED — server → client: what payment is acceptedPAYMENT-SIGNATURE — client → server: the signed payment payloadPAYMENT-RESPONSE — server → client: settlement result (tx hash, payer, amount)