See Example Configs ▶
{ "x402Version": 2, "resource": { "url": "https://api.example.com/endpoint" }, "accepts": [{ "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "5F5Yy9qJov8xK67vEWRoZHppWHEmH3WuG7mSfvLuqUTz", "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "amount": "25000", "maxTimeoutSeconds": 300 }] }
Canonical v2 format. Recommended for all new endpoints.
Integrate
📦npm
Validate configs in your app, server, or website
npm i x402lint
>_CLI
Check endpoints from your terminal
npx x402lint
🤖Claude Skill
Teach Claude to create valid x402 configs
npx skills add https://github.com/rawgroundbeef/x402lint
Define Your Schema

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.

V2 Bazaar Extension

Recommended

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.

{ "x402Version": 2, "accepts": [{ /* ...payment config... */ }], "extensions": { "bazaar": { "info": { "input": { "type": "http", "method": "GET", "queryParams": { "city": "San Francisco" } }, "output": { "type": "json", "example": { "temperature": 72, "weather": "foggy" } } }, "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "input": { "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "method": { "type": "string", "enum": ["GET"] }, "queryParams": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } } } } } }
Tip: 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.

V1 outputSchema

Legacy

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.

{ "x402Version": 2, "accepts": [{ "scheme": "exact", "network": "eip155:8453", "payTo": "0x...", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amount": "10000", "outputSchema": { "input": { "type": "http", "method": "POST", "bodyType": "json", "bodyFields": { "prompt": { "type": "string", "required": true, "description": "The prompt to send" } } }, "output": { "result": { "type": "string" } } } }] }
Note: x402scan requires an input schema to list a resource. If your endpoint accepts parameters, always declare them — otherwise agents won't know how to call you.
SDK note: The Coinbase x402 SDK provides 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.

FAQ

What is x402? ▶
x402 is a protocol for machine-to-machine payments over HTTP. When an endpoint requires payment, it returns HTTP status 402 Payment Required with a config describing how to pay. Agents read this config, send payment, then retry with proof.
What should my endpoint return? ▶
For unpaid requests: HTTP status 402 with config in response body (JSON) or PAYMENT-REQUIRED header (base64). After payment verification: return 200 with your actual response.
Which chains and formats are supported? ▶
Chains: base (eip155:8453), solana (solana:5eykt...), base-sepolia, solana-devnet, avalanche, and more. Networks use CAIP-2 identifiers internally.

Formats: Three formats are supported: Flat (legacy), v1 (accepts), and v2 (canonical). All work, but v2 is recommended for new endpoints.

Powered by the x402lint SDK.
Why is my config failing? ▶
Common issues:
• Missing address or amount
• Wrong chain name (must be lowercase: solana not Solana)
• Address format doesn't match chain (base58 for Solana, 0x for Base)
• Endpoint not returning 402 status
How do I list on x402jobs? ▶
Add marketplace metadata (name, description, outputSchema) to your v2 config, then submit at x402jobs.com. Complete listings get better placement.
How do I define API parameters for my resource? ▶
Add a schema to your 402 response so agents know what parameters to send. The recommended approach is the V2 Bazaar extension (extensions.bazaar) which includes both an example and a JSON Schema. See the Define Your Schema section above, or read the Coinbase Bazaar spec.
What is the Bazaar extension? ▶
Bazaar is the official discovery layer for x402 resources. It lives at 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.