accepts array

The accepts array is the list of payment options in an x402 payment challenge: what an endpoint returns with HTTP 402 when a request arrives unpaid. Each element of that array is one payment option the endpoint will take, stated in machine-readable terms.

An element of accepts names the scheme, the network, the asset contract, the amount in the asset's base unit, the payTo address, the resource being paid for and a validity window. exact is the scheme the specification defines for EVM networks — the chains that run Ethereum's virtual machine. A client reads the array, picks an option it can satisfy, and signs an authorization for that option.

Where the array travels is a matter of the transport, and it has moved. The current HTTP transport carries it inside the PAYMENT-REQUIRED response header, encoded, and leaves the response body to the server. The earlier transport carried it as JSON in the body, under field names of its own. Endpoints of both kinds are live, so a client has to read the one it was answered with.

HTTP 402 is the status the response carries; RFC 9110 reserves that code and defines no format for it, so everything actionable comes from the protocol layered above. That is why two endpoints can both answer HTTP 402 and still be unreadable to the same client: the status says a payment is required, and the array says what would satisfy it.

→ probe402 retains the quote it read at each check — reach a tracked endpoint's page from the endpoint list.

Sources

Related HTTP 402 · payTo · facilitator · payment challenge · transport

Glossary