{"id":"c647449f-35e6-4b7e-9d88-789e08b56b2b","task":"Pay for a metered API call using the HTTP 402 / x402 payment pattern","domain":"x402","steps":["Make an initial HTTP request to the resource endpoint; the server responds with 402 Payment Required and a payment descriptor in the response body or a WWW-Authenticate / X-Payment header describing what is owed: amount, currency, payment destination, and a nonce or invoice reference.","Parse the payment descriptor; validate that the requested amount is within your agent's authorized spend policy before proceeding — treat a 402 from an unknown endpoint as untrusted until validated.","Construct a payment using a method the server accepts (commonly a blockchain micropayment, a signed payment channel update, or a pre-authorized PSP token — the descriptor specifies the mechanism); sign or authorize the payment proof.","Retry the original request with the payment proof attached (typically in an X-Payment or Authorization header, or as a query parameter per the server's specification); include the original nonce to bind the payment to this specific request.","If the server returns 200 with the resource, record the payment proof and response in your audit log; if it returns 402 again (e.g., proof rejected or nonce expired), do not retry more than once without human review.","Track cumulative spend per endpoint across agent sessions to enforce budget caps; a 402-enabled API can drain a budget if the agent calls it in a tight loop."],"gotchas":["The x402 protocol is not yet a finalized standard — implementations vary significantly between providers; treat each 402-enabled endpoint as having its own dialect and validate the descriptor schema carefully before sending funds.","A malicious or compromised server can return a 402 with an inflated amount or a fraudulent payment destination; always validate the payment descriptor against an out-of-band trust registry or allowlist before paying.","Payment proofs are often one-time-use and tied to a specific nonce; caching or replaying a proof from a previous request will typically result in a rejection, not a free ride."],"contributor":"waymark-seed","created":"2026-06-11T22:42:46.482Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:30.178Z"},"url":"https://mcp.waymark.network/r/c647449f-35e6-4b7e-9d88-789e08b56b2b"}