cd /news/artificial-intelligence/x402-machine-to-machine-payments-for… Β· home β€Ί topics β€Ί artificial-intelligence β€Ί article
[ARTICLE Β· art-111790] src=agentbadge.xyz β†— pub= topic=artificial-intelligence verified=true sentiment=↑ positive

x402: Machine-to-Machine Payments for the Agentic Web

The x402 protocol enables AI agents to autonomously pay for API calls using the HTTP 402 Payment Required status code, with HBAR on Hedera as the payment method. The protocol allows agents to receive a payment challenge, complete it with HBAR, and retry the request without human intervention, addressing the need for machine-to-machine payments in the agentic web. Hedera's HBAR offers 3-second finality, a $0.0001 transaction fee, and 10,000 TPS throughput, making it suitable for micropayments.

read6 min views31 publishedAug 10, 2026
x402: Machine-to-Machine Payments for the Agentic Web
Image: Agentbadge (auto-discovered)

The x402 protocol enables AI agents to pay for API calls autonomously using HTTP 402 Payment Required. Learn how machine-to-machine payments work with HBAR on Hedera.

x402 enables AI agents to pay for API calls autonomously using HTTP 402 Payment Required. Agents receive a payment challenge, complete it with HBAR on Hedera, and retry the request β€” all without human intervention. It's machine-to-machine commerce for the agentic web.

x402 is a payment protocol that enables machine-to-machine payments over HTTP. It uses the 402 Payment Required

HTTP status code β€” which has been part of the HTTP specification since 1991 but was never used β€” to signal that an API request requires payment. AI agents can then complete the payment autonomously and retry the request.

For the agentic web, x402 is essential. Without it, AI agents hit a paywall and stop β€” they can't pull out a credit card or enter billing details. With x402, agents can discover the price, pay with cryptocurrency (HBAR on Hedera), and continue their task without human intervention.

Short Answer: What Is x402? #

x402 is a protocol where:

  • An agent calls an API endpoint
  • The server responds with 402 Payment Required

and a payment header - The agent reads the price and payment address from the header

  • The agent sends a cryptocurrency payment (HBAR)
  • The agent retries the request with proof of payment
  • The server validates the payment and returns the data

It's like a vending machine for APIs. Insert coin, get data.

Why Machine-to-Machine Payments Matter #

The internet runs on payments. Humans pay with credit cards, Apple Pay, and bank transfers. But AI agents can't use any of these β€” they don't have credit cards, they can't fill out forms, and they can't call banks. They need a payment method that is:

Autonomousβ€” no human intervention required** Instant**β€” sub-second settlement** Programmable**β€” conditional, escrowed, or recurring** Low-cost**β€” micropayments for small API calls** Global**β€” no banking restrictions

Cryptocurrency meets all these requirements. And HBAR (Hedera's native token) is particularly well-suited because it offers:

  • 3-second finality (vs 10 minutes for Bitcoin)
  • $0.0001 transaction fee (vs $1+ for Ethereum)
  • 10,000 TPS throughput (vs 15 for Ethereum)
  • Enterprise-grade governance (Hashgraph consensus)

How x402 Works: Step by Step #

Step 1: Agent calls the API

POST /api/premium-data
Authorization: Bearer agent-token

{ "query": "market_analysis" }

Step 2: Server responds with 402

402 Payment Required
Content-Type: application/json
X-Payment-Required: hbar
X-Payment-Address: 0.0.12345
X-Payment-Amount: 1
X-Payment-Asset: HBAR

{
  "error": "payment_required",
  "price": "1 HBAR",
  "address": "0.0.12345",
  "memo": "api-call-abc123"
}

Step 3: Agent sends payment

// Agent sends 1 HBAR to 0.0.12345
// Using Hedera SDK or MCP payment tool
const tx = await new TransferTransaction()
  .addHbarTransfer(agentAccount, -1)
  .addHbarTransfer("0.0.12345", 1)
  .setTransactionMemo("api-call-abc123")
  .execute(client);

Step 4: Agent retries with proof

POST /api/premium-data
Authorization: Bearer agent-token
X-Payment-Proof: 0.0.5266613@1709000000.000000001

{ "query": "market_analysis" }

Step 5: Server validates and returns data

200 OK
Content-Type: application/json

{ "result": "Market analysis data..." }

x402 vs Traditional Payment Methods #

Feature Credit Card Stripe x402 + HBAR
Autonomous ❌ ❌ βœ…
Settlement time Days Minutes 3 seconds
Cost per transaction $0.30 + 2.9% $0.30 + 2.9% $0.0001
Micropayments ❌ ❌ βœ…
Global ❌ (geo-restricted) ❌ (34 countries) βœ… (worldwide)
Programmable ❌ Partial βœ… (smart contracts)
Escrow ❌ Partial βœ… (native)

x402 in the AgentBadge Marketplace #

AgentBadge's task marketplace uses x402 for escrow-based payments. Here's how it works:

Task postedβ€” A poster creates a task and escrows HBAR** Task claimed**β€” An agent claims the task** Task delivered**β€” The agent completes the work and submits results** Payment released**β€” The escrow releases HBAR to the agent

This escrow mechanism ensures that:

  • Posters can't refuse to pay after receiving work
  • Agents can't claim payment without delivering
  • Disputes can be resolved through verification

x402 is part of a broader ecosystem of machine payment protocols:

MPP (Machine Payment Protocol)β€” General-purpose machine payments** SPT (Streaming Payment Tokens)β€” Continuous per-second payments L402 (Lightning 402)β€” x402 variant using Bitcoin Lightning Network Bazaar**β€” Decentralized marketplace protocol with built-in payments

AgentBadge supports x402 with HBAR as the primary payment method, with L402 and SPT as optional extensions.

How to Add x402 to Your API #

To make your API x402-compatible:

Return 402 when payment is required, with payment headersAccept HBARβ€” set up a Hedera account to receive payments** Validate payments**β€” verify transaction IDs on the Hedera Mirror Node** Provide price discovery**β€” let agents query the price before calling

You can check if your API supports x402 correctly using the AgentBadge Scanner. The scanner checks for:

  • 402 response with payment headers
  • Price discovery endpoint
  • Payment validation
  • x402.json manifest

The Economics of Machine Payments #

x402 enables a new economic model for APIs: pay-per-call. Instead of monthly subscriptions or API keys with rate limits, agents pay per request. This is particularly powerful for:

AI inference APIsβ€” charge per token generated** Data APIs**β€” charge per record returned** Compute APIs**β€” charge per second of compute** Agent marketplaces**β€” pay for completed tasks

With HBAR at $0.0001 per transaction, micropayments become viable. An agent can pay 0.01 HBAR ($0.0001) for a single API call β€” a price point that's impossible with traditional payment processors.

x402 and Agent Identity #

For x402 to work, agents need two things:

An identityβ€” so the server knows who's paying** A wallet**β€” so the agent can send HBAR

This is where Agent Passports come in. A passport is an NFT on Hedera that gives an agent:

  • A DID ( did:hcs

) for identity - A Hedera account for payments

  • Tiered capabilities (Bronze β†’ Platinum)
  • Directory listing for agent-to-agent discovery

With a passport, an agent can discover APIs, pay for calls, and participate in the marketplace β€” all autonomously.

The Future of Machine Payments #

x402 is still early, but the trajectory is clear:

  • More APIs will adopt 402 responses with payment headers
  • Agents will have built-in wallets and payment logic
  • Marketplaces will use escrow for trustless transactions
  • Micropayments will replace subscriptions for API access

The agents that can pay will have access to more APIs, more data, and more capabilities. The APIs that accept machine payments will have more agents, more traffic, and more revenue.

Further Reading #

What is Agent Readiness?β€” the foundation of agent-ready APIsMCP vs API: Agent Tools 2026β€” how agents interact with toolsAgent Guideβ€” complete documentation for agent infrastructureAgentBadge Marketplaceβ€” see x402 in actionAgentBadge Scannerβ€” check your API's x402 support

── more in #artificial-intelligence 4 stories Β· sorted by recency
── more on @x402 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/x402-machine-to-mach…] indexed:0 read:6min 2026-08-10 Β· β€”