Skip to content
[bmdpat]
All writing
Updated 3 min read

HTTP 402 Payment Required: Meaning, Uses, and x402 (2026)

HTTP 402 means Payment Required. See what the HTTP standard leaves undefined, how x402 V2 handles payment, and what to check before retrying.

Share LinkedIn

TL;DR

  • HTTP 402 Payment Required is reserved for future use in RFC 9110. It does not define a universal payment method or client retry behavior.
  • x402 V2 adds a versioned payment exchange: PAYMENT-REQUIRED, PAYMENT-SIGNATURE, and PAYMENT-RESPONSE. Do not mix V1 header names with a V2 integration.
  • Payment verification and settlement still need an implementation. Use a compatible facilitator or implement that work in the server; HTTP transport alone does not provide it.
  • Diagnose rejected payments against the exact scheme, network, asset, amount, and provider response. A local latency measurement or pricing workaround does not establish a universal protocol limit.

Cap agent run cost with AgentGuard

HTTP 402 means Payment Required. The HTTP standard reserves the code for future use. It does not define a universal payment method or tell your client how to pay. An API that returns 402 needs its own payment contract.

Correction, September 8, 2026: I mixed x402 V1 and V2 details in the original walkthrough. I also described an old payment error too broadly. This revision separates the current protocol from my original build account.

What does HTTP 402 tell you?

RFC 9110, section 15.5.3 reserves 402 for future use. A 402 response alone does not establish that a server uses x402. Read that API's documentation and response before deciding what to do next.

I removed the unsupported claim that the code had been reserved since 1991. The earlier description of RFC 7231 as calling it experimental was also wrong. Its section 6.5.2 says it is reserved for future use.

How x402 V2 uses the status code

x402 defines a payment exchange around HTTP 402. In the documented V2 flow:

  1. The client requests a paid resource.
  2. The server returns 402 with payment requirements in the PAYMENT-REQUIRED header.
  3. The client selects a supported option and creates the payment payload for that scheme.
  4. The client retries with that payload in PAYMENT-SIGNATURE.
  5. The server verifies the payment, performs the work and settles payment. It returns the result with settlement information in PAYMENT-RESPONSE.

The official facilitator guide describes these headers and the verification and settlement steps. A facilitator can handle payment verification and blockchain settlement for the server. It is optional. A server can implement those responsibilities itself.

That still requires payment infrastructure. Returning a 402 by itself does not collect money.

Check the version before copying a request

Detailx402 V1x402 V2
Client payment headerX-PAYMENTPAYMENT-SIGNATURE
Settlement response headerX-PAYMENT-RESPONSEPAYMENT-RESPONSE
Network identifier examplebase-sepoliaeip155:84532
Version fieldx402Version: 1x402Version: 2

These differences come from the official V1 to V2 migration guide. The examples in the network row refer to Base Sepolia, a test network. My original walkthrough combined a V1 payment header with V2 network notation. Do not copy that combination into a new integration.

What remains of my original build account

The April 27 post described a paid memory API using Coinbase CDP on Base. It reported a three-second round trip and an invalid_payload error that stopped after a price change.

Those were claims in the original account. I have not reproduced the timing or established a current facilitator minimum for this correction. They are not a benchmark, a protocol guarantee or a recommended price. I have removed the advice to raise the amount first when that error appears.

What I would check before retrying

Start by recording the HTTP status, error body, client package version and protocol version. Then compare the request with the documentation for the exact server and facilitator you use.

Check the selected network, asset, amount units and payment scheme. Keep the failure response with the request record. A generic error is not enough evidence to change the price or authorize another payment.

For an agent integration, I would also set a spending limit before testing repeated calls. A successful payment request tells you that one request worked. It does not tell you that a repeated job will stay within budget.

Inspect AgentGuard's runtime limits before adding paid calls to an agent loop.

FAQ

What is HTTP 402 Payment Required?

RFC 9110 reserves HTTP 402 Payment Required for future use. The status code alone does not define how to pay. A service or protocol such as x402 specifies the payment requirements and retry flow.

What is x402?

x402 defines a payment flow using HTTP 402. In V2, PAYMENT-REQUIRED carries the requirements, PAYMENT-SIGNATURE carries the client's payment payload, and PAYMENT-RESPONSE carries the settlement result. V1 uses different headers; match the client and server protocol versions.

Get the Local AI Field Kit

Four copy-ready tools now, then one evidence-backed Local AI Lab Note on Friday when there is something worth sharing.

Try the free agent run check first

Get the requested artifact now, then at most one evidence-backed Local AI Lab Note on Friday when there is something worth sharing. One-click unsubscribe. No sponsored placements. Privacy.

PH

Patrick Hughes

I build BMD and publish measured AI runs, failure reports, and reusable checks. Nashville, Tennessee.

More writing