HTTP 402 Payment Required status code explained

Updated 2026-11-06

HTTP 402 Payment Required is a status code reserved in the HTTP specification for cases where payment is needed to complete the request. For decades almost no public API used it. The open x402 protocol gives 402 a concrete, machine-readable payment flow so an AI agent or script can pay per call in a stablecoin (usually USDC) without creating an account or API key.

What HTTP 402 means

In the HTTP status registry, 402 Payment Required sits with other 4xx client errors. The intent is: the server understood the request, but will not fulfill it until the client pays. Unlike 401 (Unauthorized) or 403 (Forbidden), 402 is specifically about payment, not identity or permission alone.

Browsers and most web apps historically ignored 402. x402 revives it for programmatic clients: the unpaid response carries price, network, asset and pay-to details; after the client pays, it retries the same request with proof of payment.

How x402 uses status 402

  1. Client calls a paid HTTPS endpoint with no payment attached.
  2. Server responds 402 Payment Required with machine-readable requirements (in x402 v2, often the PAYMENT-REQUIRED header).
  3. Client signs a payment for that exact amount and retries with a payment signature.
  4. Server verifies (often via a facilitator), settles, and returns the resource (200).

Step-by-step for builders: how to pay for an API with USDC via x402. To accept payment on your own API: accept USDC for your API.

402 vs 401 vs 403

  • 401 Unauthorized — authentication is missing or failed (who are you?).
  • 403 Forbidden — authenticated or known, but not allowed (you may not).
  • 402 Payment Required — payment is required for this resource (pay to proceed).

Where to see live 402 APIs

YourAITools tracks APIs that return a valid x402 payment challenge on unpaid calls. Start with what is x402, the best x402 APIs hub, x402 alternatives, and our free x402 endpoint checker.

New to x402, the HTTP 402 payment standard these APIs use? Read what x402 is and how agents pay per call.

Liked this guide? Get new crypto-payable AI tools weekly

One short email a week with the x402 and pay-per-call tools we added and re-verified. No spam, unsubscribe any time.

Run an AI tool, API or agent that accepts crypto?

List it on YourAITools for free. Want it live sooner or pinned in its category? Fast-track review is $19, Featured for 30 days is $29 and the Launch bundle is $49, paid in USDC on Base, Polygon, Arbitrum One or Solana with one x402 payment. Every listing gets the same review, and paid placements are always labeled.

Paid checkout: api.youraitools.co/listing. Payment doesn’t guarantee approval; rejected submissions are refunded in USDC.

Keep exploring

Guides