x402 + DERO

The internet-native payment rail
for agentic commerce.

DeroPay implements x402 as a DERO-native protocol loop, so APIs can monetize per request with machine-readable payment challenges and proof-based retries.

Request loop

See it negotiate payment

A complete x402 exchange — request, challenge, settlement, proof, delivery — on the wire.

GET
Client requests a paid resourceGET /api/inference — no payment yet
402
Server returns a payment challengeMachine-readable: amount 0.10 DERO, resource, invoice id
PAY
Agent pays on DEROOn-chain DERO payment settled via the x402 contract
RETRY
Client retries with proofAuthorization: X402 proof… — signed, optional single-use
200
Server verifies and respondsSigned receipt issued; resource delivered
Why x402

Protocol-level pricing for the API economy

Agent-Ready by Design

Machine-readable 402 challenges let clients, bots, and agents negotiate payment without human checkout flows.

Deterministic Request Loop

Request → 402 → pay → retry with proof → response. Same HTTP mental model, now with value exchange.

Production Security

Signed receipts, optional single-use replay protection, key rotation, and auditable events make payment-gated endpoints safe to operate. Note: x402 payments are not sender-anonymous — the payer's address is recorded on public chain state (see SECURITY.md).

Operational Controls

Enforce quotas and dynamic pricing policies per route — no separate billing system to bolt on.

Developer flow

Add x402 in a few lines

x402-guard.ts
import { createX402RouteGuard } from "dero-pay/next";

export const x402Guard = createX402RouteGuard({
  getEngine: paymentHandlers.getEngine,
  receiptSecret: process.env.DEROPAY_RECEIPT_SECRET!,
  policy: {
    name: "Agent Inference",
    amountAtomic: deroToAtomic("0.10"),
    resource: "/api/protected/inference",
  },
});

Monetize your API per request.

Give agents and bots a native way to pay — machine-readable challenges, proof-based retries.