x402
The open HTTP standard for machine-payable APIs. Servers return HTTP 402 Payment Required with payment instructions; clients retry with proof of payment. Built for AI agents paying on-chain in seconds.
Origin
x402 was developed by the Coinbase Developer Platform team and published as an open specification at x402.org. It builds on the rarely-used HTTP 402 status code, which was reserved in HTTP/1.1 for "future use" and has finally found its actual purpose: machine-readable payment requirements.
How it works
- Request: client GET
/api/paid-endpoint - 402 response: server returns
{ accepts: [{ asset, network, amount, payTo }] } - Payment: client sends on-chain payment to
payTo - Retry: client GETs again with
X-Payment-Tx: 0x... - Verification: server reads the on-chain receipt, confirms the recipient and amount, serves the data
Discovery in x402 V2
V2 added a discovery extension. Services publish a JSON manifest at /.well-known/x402 that lists every paid endpoint with its accepts block, input schema, and metadata. Facilitators like CDP Bazaar crawl this manifest to auto-index services. TensorFeed's manifest is at /.well-known/x402.
Why it matters for AI agents
AI agents do not have credit cards, signup forms, or copy-paste API keys. The whole stack of traditional payment infrastructure assumes a human at a keyboard. x402 lets agents act on their own spending decisions without a human in the loop, which is the actual unlock for autonomous commerce.
TensorFeed's implementation
TensorFeed supports x402 as a fallback flow on every premium endpoint. Call any /api/premium/* URL without auth, get a 402 with payment instructions, retry with X-Payment-Tx: 0x... and receive both the data and a bearer token for future calls. The agent payments docs walk through it end-to-end.
For repeat use we recommend the credits-first flow over per-call x402: settlement is 50ms instead of 3-5 seconds. But x402 stays available for one-shot discovery calls where the agent doesn't want to pre-commit to credits.
Further reading
- x402.org — official spec and whitepaper
- github.com/coinbase/x402 — reference implementations
- Why we picked USDC on Base over Stripe — TensorFeed's rationale for adopting x402
- Agent payments — the broader pattern x402 enables