Bag is live — accept USDC & card payments globally. Get started →
BagBag Docs
Finance

x402

Pay-per-use access to APIs, content, and services using the x402 protocol.

x402

x402 is a payment protocol that uses the HTTP 402 "Payment Required" status code to enable instant, programmatic payments over the internet. Bag provides full x402 support as a Merchant of Record, handling compliance, tax, and settlement so you can monetize APIs and content with per-request pricing.


What is x402?

x402 allows APIs, websites, and services to require payment before granting access — without subscriptions, API keys, or manual payment processing.

PropertyDetail
ProtocolHTTP 402 "Payment Required" status code
Settlement~200ms on-chain (USDC)
PaymentStablecoin (USDC) on supported networks
AccountsNone required — pay with a wallet
Facilitatorx402.org open standard

How It Works

  1. Client requests a protected resource (API endpoint, content, data)
  2. Server returns 402 with payment instructions if no valid payment is included
  3. Client pays — USDC is sent on-chain
  4. Payment verified — the x402 facilitator confirms the transaction
  5. Access granted — the server returns the requested resource

The entire flow happens in a single HTTP request/response cycle from the client's perspective.


Use Cases

API Monetization

Charge per API call without subscriptions:

  • Weather API: $0.01/query
  • Translation: $0.05/1k characters
  • Image recognition: $0.10/image

AI Agent Commerce

AI agents can autonomously discover and pay for services:

  • Real-time data lookups
  • Compute resources
  • Proprietary knowledge bases

Content Micropayments

Monetize individual content:

  • News articles: $0.05/article
  • Research papers: $1.00/download
  • Video content: $0.25/view

On-demand Services

Pay-per-use digital services:

  • Cloud compute per second
  • Data storage per GB/day
  • Email validation: $0.001/email

What Bag Handles

As the Merchant of Record for x402 payments, Bag provides:

  • KYT/AML screening on all x402 payments
  • Tax calculation and remittance per jurisdiction
  • Payment settlement and reconciliation
  • Dispute resolution for contested payments
  • Compliance with local regulations

You receive clean fiat or USDC payouts with consolidated settlement invoices.


Supported Networks

USDC on Base, Polygon, Ethereum, and Solana.


x402 vs Traditional Payments

Featurex402Traditional (Cards/Subscriptions)
Settlement time~200ms1–3 business days
Transaction fees< $0.012–3% + $0.30
Minimum payment$0.0001~$0.50
Chargeback riskNone (blockchain finality)Yes (60–120 days)
Geographic restrictionsNoneMany
Account requiredNoYes
Programmatic accessNativeComplex

What's next

For a step-by-step integration guide with code, see the Agentic Payments guide.

On this page