← All posts

Mar 18, 2026

Giving Your AI Agent a Bank Account: The x402 Protocol Explained

What x402 is, why Coinbase revived HTTP 402, and how Tychi uses it to let AI agents pay onchain without managing gas, custody, or bridges.

x402AI AgentsHTTPPaymentsCoinbase

For most of the last two decades, HTTP 402 was a curiosity in the spec. 402 Payment Required — reserved for future use, never standardized, never widely adopted. Browsers showed it on a few obscure paywalls and that was it.

In 2024 Coinbase revived it as a stablecoin payment protocol. The premise is simple: when a server wants to charge for a resource, it returns 402 with a structured payment instruction. The client pays in stablecoins, retries the request, and gets the resource. No payment processor. No subscription. No webhook plumbing. Just an HTTP exchange with money attached.

In 2026 this is becoming the substrate for agentic payments — AI agents paying for APIs, services, and actions on behalf of their users. This post explains what x402 actually is, where it fits, and how Tychi uses it.

How x402 works

The flow has three messages:

  1. Client requests a resource. GET to some endpoint.
  2. Server replies 402 Payment Required with a payment directive in headers or body. The directive specifies amount, currency, recipient, and supported payment rails.
  3. Client pays and retries. Pays the directive (typically a stablecoin transfer with metadata). Retries the original request, attaching proof of payment.
  4. Server validates and serves. Confirms the payment landed, returns the resource.

The novelty isn't the payment itself — onchain transfers have existed for a decade. The novelty is standardizing the handshake so any HTTP client and any HTTP server can speak it. No SDK lock-in. No proprietary platform.

Why this matters for AI agents

AI agents pay for things. APIs they query, models they call, services they invoke. Today most of that goes through credit-card-on-file accounts at OpenAI, Anthropic, AWS. The user pays a monthly bill and the agent borrows from that quota.

That model breaks at the edges:

  • Per-call billing with credit cards has minimum-charge friction (Stripe's $0.30 minimum kills micropayments).
  • Cross-platform spending requires the user to have an account on every platform the agent uses.
  • Programmatic provisioning is awkward — the agent can't open a new payment account without the user.
  • Auditability of agent spending is opaque.

x402 sidesteps all of it. The agent has a wallet. Each call costs whatever the server says. Settlement is per-request, in stablecoins, on rails the agent's wallet already speaks.

Where Tychi fits

Tychi's UGF SDK speaks x402 natively. Concretely:

await client.payment.x402.execute({
  quote,
  signer: wallet,
  token: "USDC",
});

That call sends the x402-formatted payment for a quoted action. The agent doesn't need to know how the destination chain settles, where the relayer is, or what native gas the destination chain requires. UGF handles cross-chain delivery; x402 handles the protocol exchange.

For an AI agent, this means:

  • A single USDC balance funds activity across twelve chains.
  • The agent's wallet is self-custodial — the agent owns its keys.
  • Per-call payments work without subscription friction.

A concrete example

Picture two agents:

  • Agent A is doing portfolio analysis for a user.
  • Agent B is a forecasting service that returns price predictions.

Agent A calls B's /forecast endpoint. B replies 402 with: "10 USDC to address 0x..., on Base, within 60 seconds." Agent A signs the payment via UGF, retries the request with proof, B serves the forecast. The exchange takes a few seconds and costs less than a Stripe transaction.

Now multiply by dozens of agents calling hundreds of services per minute. The economics only work if the protocol is stateless and standardized. x402 is both.

Why x402 is becoming the HTTP of agentic payments

Three properties make it sticky:

  • It's HTTP. Every web framework, every client library, every CDN already understands the verbs. Adding 402 handling is a middleware, not a rewrite.
  • It's chain-agnostic. The directive specifies the rail. Servers can accept payments on any supported chain.
  • It's small. The spec fits on a page. There is no big SDK to learn, no platform to subscribe to.

The contrast is ERC-4337 (account abstraction), which solves a partially overlapping problem but requires per-chain bundler infrastructure and smart-wallet adoption. x402 sits on top of any wallet, including standard EOAs. That keeps adoption costs near zero.

Where to start

If you are building agents and want to integrate x402:

The agent economy is going to need plumbing this lightweight. We think x402 plus UGF is most of it.

More posts