x402
protocol
explainer

What is the x402 Payment Protocol?

A developer's guide to HTTP 402, stablecoin micropayments, and why x402 matters for AI agents.

Ben·

The x402 payment protocol brings native payments to HTTP. Instead of credit cards, API keys, or subscription plans, clients pay per request with stablecoins.

The Problem

APIs today are monetized through API keys and monthly subscription plans. This works for humans but breaks down for AI agents, micropayments, and machine-to-machine commerce.

How x402 Works

When a client requests a paid resource without payment, the server returns HTTP 402 Payment Required with structured payment terms:

{
  "x402Version": 2,
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:8453",
    "maxAmountRequired": "10000",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
  }]
}

The client signs a USDC payment and resubmits the request. The server verifies the payment and serves the response.

Why It Matters

  • Micropayments: Pay fractions of a cent per API call
  • No accounts: No signups, no API keys, no subscriptions
  • Agent-native: AI agents can pay for APIs autonomously
  • Instant settlement: USDC on Base settles in seconds

Dunmore and x402

Dunmore is a gateway and integration hub for x402 payments. We handle verification, settlement, and connect payment events to your existing tools — Slack, Discord, Segment, webhooks, and email.

Get started with Dunmore