Pick a framework and an endpoint — get runnable pay-per-call code with the correct manual payment flow. No @x402/fetch magic: you see every step.
PAYMENT-REQUIRED response header and the X-PAYMENT request header are base64 STANDARD. Do not decode/encode them as base64url — only JWT signing uses base64url. (Fleet bug fixed 2026-10-20: clients parsing the header as base64url silently produced garbage payments.) Every snippet below decodes with standard base64.PAYMENT-REQUIRED (base64 standard) → accepts[0] has amount, USDC asset, payTo.transferWithAuthorization on USDC/Base with your wallet (viem / ethers / eth_account).X-PAYMENT = base64 (standard) of the payment JSON. Resend the same request with that header → 200.PRIVATE_KEY (Python) or WALLET_PRIVATE_KEY (TypeScript) to a Base wallet holding a little USDC. Without it the snippets run in trial mode and surface the 402 message. Every snippet caps spend per call (MAX_USD_PER_CALL, default $0.05) — raise it deliberately, never blindly.