How Rail402 lets autonomous agents pay for APIs on
@base — a breakdown.
An agent acting on its own needs three things humans take for granted: a way to pay, a way to prove who it is, and a way to credit who built what. Rail402 composes three Base-native standards to provide all three. Here is how they fit together.
x402 — Payments. When an agent calls a paid endpoint, the server replies with HTTP 402 Payment Required, encoding the amount, the recipient address, and the network directly in the response. The agent settles in USDC on Base — roughly two-second finality — and retries the request carrying the transaction hash as proof. Rail402 verifies that transfer against on-chain state before any data is returned. No API key, no account, no subscription. The payment is the authentication.
ERC-8004 — Identity. Payment answers "did they pay." Identity answers "who is calling." ERC-8004 is an on-chain registry for agent reputation and capabilities. Rail402 is designed to read it so providers can price and gate access by the caller's standing — trusted agents earn better terms, unknown ones get stricter limits. The credential is the agent's on-chain history, not a secret it has to store.ERC-8021 — Attribution. In a multi-agent pipeline, one call triggers another, which triggers another.
ERC-8021 builder codes attach revenue attribution to each step, so when value flows through a chain of delegated calls, the provider that originated the work still gets credited. Composable revenue, settled on-chain.
Together, these are the three primitives an autonomous economy runs on: x402 moves the value, ERC-8004 establishes trust, ERC-8021 routes the credit. Software transacting with software — discoverably, verifiably, with no human in the loop.
The payment layer is live on Base mainnet. The SDK, discovery spec, and MCP server are open source at
github.com/Rail402.