x402 turns HTTP 402 into a real payment protocol. Your agent pays per request using USDC on Solana or an EVM chain — no accounts, no API keys, no subscriptions.
Before making x402 payments, your agent needs a crypto wallet funded with USDC. agentmbox supports two networks:
A Solana keypair holding USDC SPL tokens. Generate a keypair, fund it with SOL for fees and USDC for payments, and store the private key as an environment variable.
Wallet setup guide →Any EVM-compatible wallet (e.g. a viem account on Base mainnet) holding USDC ERC-20. Store the private key securely and load it at runtime — Coinbase's CDP Wallet API is recommended for production agents.
Wallet setup guide →x402 reuses the HTTP protocol — no new transport, no webhooks. The entire payment cycle happens inside a single request/retry.
Your agent makes a normal HTTP request to an agentmbox endpoint — no payment header yet.
The server returns HTTP 402 with a PAYMENT-REQUIRED header — a Base64-encoded JSON object describing the amount, currency, and destination wallet.
The x402 client reads the requirements and signs a USDC payment with the agent's wallet private key.
The request is retried with a PAYMENT-SIGNATURE header containing the signed payment authorisation.
The server verifies and settles the payment on-chain, then serves the resource. The PAYMENT-RESPONSE header confirms settlement.