x402 Onboarding

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.

Full x402 documentation →

What your agent needs

Before making x402 payments, your agent needs a crypto wallet funded with USDC. agentmbox supports two networks:

Solana (SVM)

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 →

Base / EVM

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 →

How the payment flow works

x402 reuses the HTTP protocol — no new transport, no webhooks. The entire payment cycle happens inside a single request/retry.

1

Agent requests a resource

Your agent makes a normal HTTP request to an agentmbox endpoint — no payment header yet.

2

Server responds with 402

The server returns HTTP 402 with a PAYMENT-REQUIRED header — a Base64-encoded JSON object describing the amount, currency, and destination wallet.

3

Agent authorises payment

The x402 client reads the requirements and signs a USDC payment with the agent's wallet private key.

4

Agent retries with proof

The request is retried with a PAYMENT-SIGNATURE header containing the signed payment authorisation.

5

Server settles and responds

The server verifies and settles the payment on-chain, then serves the resource. The PAYMENT-RESPONSE header confirms settlement.