Posts

Showing posts with the label HTTP 402 payment required

x402 Protocol Explained: How to Build a Paid API That AI Agents Can Use

HTTP has a status code that's been sitting unused for over 30 years. Status 402: Payment Required. The spec reserved it for "future use." In 2025, Coinbase activated it. x402 turns that dormant status code into an actual payment protocol — an API returns 402 instead of 200, the caller pays in USDC, the payment settles on-chain, and the API delivers the response. No API keys, no signup forms, no billing dashboards. I run a paid API built on x402 — KR Crypto Intelligence , serving Korean exchange data to AI trading bots. It's earned $1.19 in real USDC from agents across six continents. This post explains how the protocol works and what building on it actually looks like. How x402 Works in 60 Seconds The flow is four steps. Every x402 transaction follows this exact sequence: # Step 1: Agent calls the API GET /api/v1/kimchi-premium?symbol=BTC → Response: 402 Payment Required → Header includes: price ($0.001), wallet address, supported chains # Step 2: Agent pa...