Docs/Payments/Crypto Payments (x402)

Agent-to-Agent Crypto Payments (x402)

Enable AI agents to pay for MCP tool calls using USDC stablecoins on Base network, with fees as low as $0.001 per transaction.

Currently on testnet
x402 payments are live on Base Sepolia testnet. Mainnet launch is planned for April 2026.

What is x402?

x402 is a protocol that enables machine-to-machine payments over HTTP. Inspired by the HTTP 402 "Payment Required" status code, it allows AI agents to autonomously pay for services using cryptocurrency, without human intervention.

When an agent calls a paid MCP tool, the server responds with a 402 status and payment details. The agent's wallet automatically signs a USDC transaction on the Base network, and the server verifies payment before returning results. The entire flow happens in under 2 seconds.

How It Works on Micipi

1

Agent calls your MCP tool

An AI agent discovers your server in the Micipi marketplace and sends a tool call request through the gateway.

2

Gateway returns 402 Payment Required

The Micipi gateway intercepts the request and returns a 402 response with the price (in USDC), the payee address, and a payment nonce.

3

Agent signs USDC payment

The calling agent's wallet signs a USDC transfer on Base network for the exact amount. No gas fees are needed thanks to ERC-4337 account abstraction.

4

Gateway verifies and forwards

The gateway verifies the payment signature on-chain, confirms the USDC transfer, and forwards the original tool call to your server.

5

Creator receives 85% revenue

You receive 85% of the payment in your connected wallet. Micipi retains 15% as a platform fee. Payouts settle instantly on Base.

Why Crypto for Agent Payments?

Traditional payment rails are designed for humans. Agent-to-agent transactions need different infrastructure:

FactorTraditional (Stripe)x402 (USDC on Base)
Minimum fee$0.30 + 2.9%~$0.001
Settlement time2-7 business days~2 seconds
MicropaymentsNot viable (<$1)$0.001 and up
Machine-to-machineRequires human authFully autonomous
Global accessCountry restrictionsBorderless

Getting Started

1. Enable x402 on your server

In your server settings on the Micipi dashboard, toggle "Enable x402 Payments" and set a per-call price in USDC.

2. Connect your wallet

Link a Base-compatible wallet (e.g., Coinbase Smart Wallet) to receive USDC payouts. This is where your 85% revenue share will be sent.

3. Test on Sepolia

Use testnet USDC to verify the payment flow works correctly before going live.

Test payment flow
# Request testnet USDC from the Micipi faucet
curl -X POST https://gateway.micipi.com/faucet \
  -H "Authorization: Bearer mcp_your_key" \
  -d '{"amount": "10.00"}'

# Call a paid tool — payment happens automatically
curl https://gateway.micipi.com/s/your-server/sse \
  -H "Authorization: Bearer mcp_your_key" \
  -H "X-402-Wallet: 0xYourWalletAddress"

4. Monitor earnings

Track revenue in real time on the Micipi dashboard. Each tool call shows the USDC amount, transaction hash, and caller identity.

Start earning from AI agents

Create a paid MCP server and enable x402 payments to earn USDC from every tool call.

Get Started Free