402 challenge builder
Build the HTTP 402 response for a price and see how an ndStill agent decides on it.
Sellers charge agents per call, per session, per result or per MCP tool call by answering an unpaid request with HTTP 402 Payment Required and a machine-readable challenge. Describe a price on the left, and the builder shows the exact challenge Accept would send, then the decision an ndStill agent would get before its wallet signs. It runs against the in-browser mock: nothing is published or charged.
Building…
What the challenge contains#
- The 402 response. An x402 version 1 body with one entry in
accepts[]per rail you take: for USDC,scheme: "exact",network,asset,maxAmountRequiredin atomic units (USDC has 6 decimals, so $0.01 is10000),payTo,resource,descriptionandmaxTimeoutSeconds. Checkout and bank options appear as their own entries. AWWW-Authenticate: Payment …header lists the methods, and anndstillblock says how buyers' agents are verified and receipted. - The MCP tool annotation. For
mcp://resources, the pricing an MCP client sees on the tool itself, so an agent can check its budget before calling. - The discovery entry. What goes in your
/.well-known/agent-pricing.json, so agents can find prices before they hit a 402.
What happens on the buyer's side#
An agent using ndStill never signs a 402 on its own. Its SDK hook (or the pay_402 MCP tool) sends the challenge to ndStill first. The full pipeline runs: mandate, policy, risk, budget and approval. Only an approved decision returns a payment approval token, bound to the amount, payTo, the resource and a nonce, valid for 60 seconds. The wallet signs against that, and the seller's facilitator settles into the seller's own wallet. ndStill never holds the funds or forwards the payment.
Read x402 and USDC for the full flow on both sides, Verify for sellers for checking the paying agent, and the Prices API to publish a price for real.