pay.json is an open standard that lets AI agents discover what content costs and how to pay before making a request. Publishers serve it at /.well-known/pay.json.
Quick start
Generate apay.json file:
https://yourdomain.com/.well-known/pay.json.
Specification (v1.0)
Required fields
| Field | Type | Description |
|---|---|---|
version | string | Must be "1.0" |
protocol | string | Payment protocol (e.g., "x402") |
network | string | Blockchain network (e.g., "base") |
asset | string | Payment token (e.g., "USDC") |
receiver | string | Splitter contract address (0x + 40 hex) |
seller_wallet | string | Publisher wallet address (0x + 40 hex) |
rules | array | Ordered list of path-to-price rules (min 1) |
Optional fields
| Field | Type | Description |
|---|---|---|
provider | string | Payment infrastructure provider |
facilitator | string | Verification endpoint URL |
contact | string | Publisher contact |
terms | string | Terms of service URL |
tools | object | CLI, SDK, and docs hints |
Example
Pricing rules
Rules are evaluated top-to-bottom. First match wins.Glob patterns
| Pattern | Matches | Example |
|---|---|---|
* | Single path segment (no /) | /blog/* matches /blog/post but not /blog/2024/post |
** | Multiple segments (including /) | /blog/** matches /blog/2024/post |
? | Exactly one character | /api/v?/data matches /api/v1/data |
Special values
"0"or"0.00"— explicitly free- No matching rule — path is free
- No pay.json file — entire site is free
Validation
Discovery priority
Agents should discover pricing in this order:- pay.json at
/.well-known/pay.json— most authoritative - Meta tag
<meta name="x402" content="supported">— fallback - HTTP 402 response — server returns payment instructions
- Free — no pricing signals found