npm i x402lint
npx x402lint
npx skills add https://github.com/rawgroundbeef/x402lint
When an agent pays for your resource, it needs to know how to call it — what parameters to send and what response to expect. x402 has two ways to declare this: the V2 Bazaar extension (recommended) and the V1 outputSchema field.
Add extensions.bazaar to your 402 response. It has two parts: info (an example showing how to call your API) and schema (a JSON Schema defining types and constraints). Together, they let agents understand and validate requests before paying.
info is "show me an example" — agents use it to understand your API at a glance. schema is "give me the contract" — agents use it to validate requests before sending.
The older approach places an outputSchema on each accepts[] entry. It defines input (HTTP method and fields) and output (response shape). Still supported, but V2 Bazaar is the standard going forward.
declareDiscoveryExtension() which accepts an inputSchema convenience field. This is an SDK-only helper — it never appears in the 402 wire format. On the wire, schemas are always delivered via extensions.bazaar.
402 Payment Required with a config describing how to pay. Agents read this config, send payment, then retry with proof.
402 with config in response body (JSON) or PAYMENT-REQUIRED header (base64). After payment verification: return 200 with your actual response.
base (eip155:8453), solana (solana:5eykt...), base-sepolia, solana-devnet, avalanche, and more. Networks use CAIP-2 identifiers internally.solana not Solana)extensions.bazaar) which includes both an example and a JSON Schema. See the Define Your Schema section above, or read the Coinbase Bazaar spec.
extensions.bazaar in your 402 response and has two parts: info ("show me an example" — concrete values an agent can try) and schema ("give me the contract" — a JSON Schema defining types, constraints, and required fields). Together they let agents discover, validate, and call your API automatically. See the Coinbase Bazaar spec for details.