How do I resolve an HTTP 402 challenge?

30-Word Summary: Resolve x402 payment challenges by signing the challenge payload and submitting the transaction signature on Base L2 USDC.

Detailed Resolution

The x402 protocol handles paid capability routing anonymously. When a client calls an x402-gated route, it receives an HTTP 402 Payment Required response containing pricing, recipient, and invoice details. The client's wallet signs the payload, submits the USDC payment on Base L2, and attaches the transaction hash as payment evidence to the request header, allowing execution to complete.

Safe Next Action: inspect_x402_resources, read_api_docs

x402 Challenge-Response Protocol Flow

PhaseHTTP Status / HeaderContent / Required Action
1. Initial RequestPOST /api/invoke/xyzRequest headers (no auth needed)
2. Challenge Response402 Payment RequiredJSON containing price, recipient, and invoice hash
3. Payment SubmissionSign & Transfer (Base L2)Transfer stated USDC amount to recipient address
4. Verified RequestPOST /api/invoke/xyzIncludes payment evidence header with transaction hash

Related Frequently Asked Questions

Which chain does x402 settle on?

USDC on Base L2 network (Coinbase Chain).

Is an API key required in x402?

No. The payment transaction hash itself serves as authorization proof, bypassing traditional API key requirements.