x402 turns every API into a monetizable endpoint for the machine web. No subscriptions. No API-key portals. Just an HTTP challenge, a cryptographic proof, and settlement-ready receipts executed at the edge.
A protocol that lets any HTTP endpoint charge for access — and any client (human or AI) pay instantly without signing up.
Built for a world where AI agents call APIs on behalf of users. No browser needed. No OAuth dance. The agent reads the 402 response, signs a proof, and retries — all autonomously.
The Gateway runs on Cloudflare Workers — the same network that powers 20% of the web. Proof verification happens at the edge. No database round-trip blocks the response.
Stripe charges 30¢ per transaction. x402 charges nothing. Proofs are cryptographic, settlements are batched on-chain asynchronously. Charge a fraction of a cent profitably.
Request. Challenge. Prove. Fulfill. Four steps. Zero friction.
An AI agent (or any HTTP client) hits a paid endpoint. It doesn't need to know the price ahead of time. The Gateway intercepts the request before it reaches the origin.
No proof? The Gateway returns 402 Payment Required with a machine-readable invoice: the asset, the amount, and a unique nonce. The agent parses this instantly.
{
"version": "fth-x402/2.0",
"asset": "USDF",
"amount": "0.25",
"invoice_id": "inv_8y3GkP",
"nonce": "n_z4zcz",
"facilitator_url": "https://..."
}
The agent signs the invoice using its Ed25519 private key — creating a prepaid credit deduction or a state channel update. No external API call. No wallet popup. It's one function call.
The agent retries with the proof header. The edge verifies the signature cryptographically, deducts the balance asynchronously, and streams the response to the agent. The whole loop takes milliseconds.
Every scenario below is possible today. x402 is the missing financial plumbing that lets autonomous agents transact without human gatekeepers.
A master agent coordinates specialist models. It sends a prompt to a code-generation agent, pays per token, then routes the output to a security-audit agent for analysis — each call settled independently via 402.
A trading bot needs live sentiment analysis. It hits a market-signal API that costs a fraction of a cent per call. The bot opens a state channel, streams hundreds of requests per second, and settles the total later.
An ML training pipeline needs fresh labeled data. It discovers a data-provider API, pays per row returned, and ingests it directly into the training loop. No contract negotiation. No sales call. The 402 header is the price tag.
A content agent composes a blog post, then calls a image generation API to create illustrations and a voice synthesis API for the audio version. Each API charges independently. The agent's wallet handles all three payments in sequence.
A CI/CD pipeline agent submits code diffs to a vulnerability scanner API and a license-compliance checker. Each scan costs micro-cents. 402 ensures every scan is paid for without monthly billing surprises.
A coordinating agent dispatches tasks to a swarm of specialist agents across different providers. Each specialist exposes an x402 endpoint. The coordinator pays each one individually — no centralized billing, no pre-negotiation.
Interactive specialist agents guide builders, product teams, and compliance operators through x402 adoption without a support ticket loop.
Guides developers through gateway routing, SDK retry behavior, proof headers, and the fastest path to production.
Explains pricing models, prepaid credit, state channels, metering, receipts, and how to monetize AI endpoints profitably.
Answers questions on auditability, evidence bundles, cryptographic proof, ESIGN posture, and regulated workflow alignment.
Yes. Use a free discovery route for metadata, pricing, and capability descriptions, then reserve paid inference, premium data, or fulfillment for the x402-protected endpoint.
Yes. x402 receipts, proof metadata, and anchored evidence can complement document workflows where auditability, deterministic pricing, and cryptographic provenance matter.
Yes. That is one of the core protocol advantages. A single agent identity can interact across multiple x402-enabled APIs without separate billing portals.
Every competitor forces agents through human-designed billing funnels. x402 is the only protocol purpose-built for machine-to-machine commerce.
HTTP 402 has existed since 1997 but nobody implemented it for real. x402 is the first production-grade protocol to activate the status code at scale.
Every new API provider that adopts x402 makes every existing agent wallet more valuable. The protocol is the lock-in — not the vendor.
Add x402 to any existing API with a single Cloudflare Worker. No backend changes. No new auth system. Your existing API just gains a monetization layer.
These are the first live-ready AI transaction lanes built on the UnyKorn-first x402 stack. Each system can issue invoices, retry with proof, surface receipts, and feed operator visibility.
Requests premium market inference, pays per provider lane, and clears the unlock through /api/v1/agent/pay-api/atlas.
Runs evidence checks, maps receipt metadata to control narratives, and watches anchored batches for audit export readiness.
Monetizes trade attestation and replay-safe verification through /api/v1/trade/verify/:trade_id.
Coordinates text, image, and voice services across paid endpoints while the treasury funds the next task automatically.
Dispatches specialist agents across multiple paid routes and rolls the outcome back into a shared operator dashboard view.
A Molt-style coordinator lane for chained AI calls. No dedicated Moltbot package was found in-repo, so this stack surfaces an orchestration-ready payment lane instead.
Use the built-in load runner to push named agent routes for seconds or minutes and measure how many challenge loops the stack clears.
Whether you're an API provider or an agent developer, integration takes minutes.
Monetize your endpoint in one config file.
Teach your agent to pay with 5 lines.
Gateway verifies proofs at the edge. Facilitator manages balances & receipts. L1 anchors finality.
Every API becomes a revenue stream. Every agent becomes a customer. x402 connects them with nothing but HTTP.