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.
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.
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:
- The client requests a paid resource.
- The server returns 402 with payment requirements in the
PAYMENT-REQUIREDheader. - The client selects a supported option and creates the payment payload for that scheme.
- The client retries with that payload in
PAYMENT-SIGNATURE. - 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
| Detail | x402 V1 | x402 V2 |
|---|---|---|
| Client payment header | X-PAYMENT | PAYMENT-SIGNATURE |
| Settlement response header | X-PAYMENT-RESPONSE | PAYMENT-RESPONSE |
| Network identifier example | base-sepolia | eip155:84532 |
| Version field | x402Version: 1 | x402Version: 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 firstGet 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.
Patrick Hughes
I build BMD and publish measured AI runs, failure reports, and reusable checks. Nashville, Tennessee.
More writing
- 5 min
Why API keys break for autonomous AI agents
Stripe doesn't ship to LLMs. Every vendor signup form assumes a human at the door. Here is what changes when wallets become the access primitive.
- 4 min
I built a memory API that AI agents can pay for
An LLM just paid me $0.001 to remember something. The agent has no account, no API key, no credit card. It just signs a USDC transfer and gets back a 200.
- 5 min
Agent Memory: Test the Answer After a Correction
Our agent-memory replay checks words in a file. I show what that proves, what it misses, and how to test whether an expert correction changes an answer.
- 6 min
My agent wrote 126 empty pages and every gate passed
One commit wrote 130 knowledge pages. 126 were the same four sentences with the title swapped. Schema checks, link checks and orphan checks all passed.
- 5 min
3 Tests Before a GGUF Quant Runs Your Coding Agent
A GGUF file fitting in VRAM does not prove it can run your coding agent. Use this local acceptance test for tools, patches, and repeat runs.