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.

Integrate x402 npm package

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 challenge -> pay -> retry with proof -> response. Same HTTP mental model, now with value exchange.

Production Security

Signed receipts, replay protection, key rotation, and auditable events make payment-gated endpoints safe to operate.

Operational Controls

Enforce quotas and dynamic pricing policies per route without bolting on a separate billing system.

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",
  },
});
See full payment stack