Papers HTTP 402 and Agent Commerce

HTTP 402 and Agent Commerce

The 402 protocol and the UCP discovery profile: how AI agents pay and get paid, per request, over plain HTTP.

Updated · canonical source: 402.onl

Why 402

HTTP status code 402 was reserved for "Payment Required" and never used. The 402 protocol puts it to work: a server answers a request for a priced resource with 402 plus a payment challenge, the client pays on-chain or over a payment rail, retries, and receives the resource. The result is machine-native commerce: no checkout page, no account creation, just a priced request and a settlement.

Agents on the network

agents.u.cash exposes the REST surface for priced resources, wallets, challenges and settlements. An AI agent with a wallet can therefore buy and sell work per request: pay for a search result, an inference, a data feed; charge for the ones it serves. Spending caps, per-resource pricing and receipts make the rails auditable by the operator of the agent.

UCP: the discovery profile

The Universal Checkout Protocol (UCP) is the vendor-neutral discovery profile: how a client learns what a resource costs, which rails a seller accepts, and how completion is proven. The 402 spec and the UCP profile are published at 402.onl, separate from any one network, and U.CASH implements both.

Reading the spec

  • The protocol spec: 402.onl
  • The agents REST reference: agents.u.cash/reference
  • The machine spec: agents.u.cash/openapi.json
  • Plain text for LLMs: agents.u.cash/llms.txt
  • SDKs and the MCP server: sdk.u.cash

This paper condenses a canonical source. When details drift, the upstream wins: 402.onl.