x402: The HTTP payment protocol for machine-to-machine commerce
x402 Protocol: HTTP 402 enables native API payments without accounts or minimums.
Credit cards weren't designed for machines. HTTP 402 Payment Required has existed since 1999, reserved for "future use." That future is now.
What is x402?
x402 is an open standard that adds native payment capabilities to HTTP. When a client requests a paid resource without payment, the server returns HTTP 402 with payment instructions. The client submits payment proof, and the server delivers the content.
The protocol operates at the HTTP layer. No separate payment flow, no redirect to checkout pages, no OAuth handshakes. A machine makes a request, receives payment requirements, signs a transaction, and resubmits.
How it works
The payment flow follows standard HTTP request-response patterns:
- Client requests your API without payment
- Server returns
402 Payment Requiredwith payment options - Client signs a blockchain transaction authorizing payment
- Client resubmits with payment proof in the request header
- Facilitator verifies payment and executes settlement
- Server delivers content
No account creation, no card details, no minimum transaction amounts.
Why businesses need x402
Traditional payment processors impose minimum fees that make micropayments impossible. You cannot profitably charge less than several dollars per transaction with card-based systems.
APIs generate value in small increments. A weather data query, an LLM inference, a real-time stock price. These operations cost fractions of a cent to produce but cannot be monetized with traditional payment rails.
x402 changes this. You can charge fractions of a cent per API request and capture revenue from usage that would otherwise be free or bundled into inefficient subscription pricing.
Revenue models enabled by x402
Pay-per-request: Client pays for a bundle of requests. Charge for 10 API calls. The client uses them until exhausted, then pays again.
Pay-per-time: Client pays for unlimited access within a time window. Charge for 1 hour of streaming data access. After the window expires, payment is required again.
These models let you price based on actual value delivered, not arbitrary tiers or seat counts.
Kobaru: the x402 infrastructure
Kobaru is the payment infrastructure for the x402 protocol. Whether you're an individual developer launching your first API or an enterprise processing millions of transactions, Kobaru handles the complexity of blockchain verification, settlement, and usage tracking.
Integration options range from zero-code to full SDK control. Configure your API in the Kobaru Console and your endpoints become payment-enabled through our proxy. Or integrate our middleware directly into your application for complete control.
For implementation details, see the Kobaru documentation.
What Kobaru handles
- Transaction signature verification across multiple networks
- Blockchain settlement (Solana, Base, SKALE)
- Idempotency and replay protection
- Usage tracking for pay-per-request and pay-per-time models
- Gas fees on all supported networks (your customers pay only the transaction amount)
- Automatic refunds when upstream services fail
What you control
- Pricing per endpoint
- Payment network selection
- Usage model configuration
- Funds settle on-chain to your wallet directly
Machine economy use cases
x402 enables machine-to-machine commerce that wasn't previously viable:
AI agents accessing APIs: An AI agent needs weather data to answer a user query. It pays, retrieves the data, and delivers the answer. No API key management, no account creation, no subscription.
Developer tools with usage-based pricing: A code formatter charges per file. Developers pay exactly for what they use. No free tier abuse, no enterprise contract negotiations.
Real-time data streams: A trading bot pays for 1 hour of unlimited market data access. The bot consumes what it needs during that window.
Content paywalls: A research paper costs a fixed amount to access. The reader pays once and downloads immediately. No recurring charges.
Protocol economics
x402 shifts payment economics from per-transaction fees to per-value pricing. When transactions cost cents to execute on blockchain networks, you can charge for individual operations rather than bundling requests into large purchases.
This changes the unit economics of API monetization. Revenue becomes proportional to value delivered. High-value users pay more because they use more. Low-value users don't subsidize power users through flat pricing.
Why businesses choose Kobaru
The x402 protocol is an open standard. Kobaru is the production-ready infrastructure that makes it work at scale:
- Multi-network support: Solana, Base, SKALE
- Edge-first architecture: Verification from global edge locations
- Built-in usage tracking: Pay-per-request and pay-per-time models work out of the box
- Intelligent refund logic: Automatic refunds when upstream services return errors
- Direct settlement: USDC arrives in your wallet, not held by intermediaries
- Gas covered: Kobaru pays gas fees on all networks
The protocol handles payment proof. Kobaru handles everything else.
Get started
Choose your integration path based on your needs:
- Zero-code proxy: Configure in Console, we handle payment logic
- SDK middleware: Add payment middleware to your Node.js, Go, or Python application
- Direct API: Call our endpoints directly via REST for any language
Complete documentation, examples, and API reference available at docs.kobaru.io.
x402 is an open standard. The specification lives at x402.org.
This post is also available in Portuguese and Spanish.