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.

/openapi.json

Machine-readable discovery doc (OpenAPI + x-payment-info) so AI agents and x402scan can find and invoke the paid services.

/api/services/[service]

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.

/protected

A demo page guarded by Next.js middleware (proxy.ts) — browsers see a paywall and pay with a connected wallet.

The payment flow

  1. 1
    Pick 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.

  2. 2
    Server 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.

  3. 3
    Client 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.

  4. 4
    Facilitator 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.

  5. 5
    Deliverable 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

  1. Get USDC (and a little ETH) on Base in your wallet.
  2. Open the explorer, pick a service, fill its inputs, and hit Pay.
  3. 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-REQUIREDserver → client: what payment is accepted
PAYMENT-SIGNATUREclient → server: the signed payment payload
PAYMENT-RESPONSEserver → client: settlement result (tx hash, payer, amount)