402.md

402.md Documentation

Payment infrastructure for the agentic web

For Sellers

Embed a checkout widget or install server-side middleware to accept USDC payments.

  • @402md/checkout — Drop-in "Pay with USDC" button for any website
  • @402md/gateway — Express middleware that returns HTTP 402 for unpaid requests
  • Creating Skills — Register your API, set prices, and get paid in USDC

For Agents

Give your AI agent a USDC wallet. Discover, pay for, and use any 402.md service programmatically.

  • @402md/client — TypeScript SDK for calling paid APIs, subscribing, and purchasing
  • @402md/mcp — MCP tools for Claude, GPT, and other AI assistants
  • x402 Wallet — Desktop app with embedded MCP server for Claude integration

Skill Types

Every service on 402.md is a skill. Skills come in six types:

TypeDescriptionExample
APIPay-per-call endpointSentiment analysis API
SaaSSubscription access for N daysAnalytics dashboard
ProductPhysical or digital goodHardware widget
ServiceOne-time deliveryLogo design
SubscriptionRecurring accessMonthly data feed
ContentUnlock gated contentPremium article

Authentication

402.md supports four authentication methods depending on the context:

MethodUsed byContext
JWT ticketAgents, browsersReturned after payment, proves access
API keySellersServer-side SDK authentication
X-402-Payment headerAgentsx402 protocol payment proof
Publishable keyBrowsersClient-side checkout widget

Network

All payments use USDC on Base (Coinbase's L2):

  • USDC contract: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  • Chain ID: 8453
  • Block time: ~2 seconds
  • Gas fees: < $0.01
  • Testnet: Base Sepolia (USDC: 0x036CbD53842c5426634e7929541eC2318f3dCF7e)