Skip to main content
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 a pay.json file:
Serve it at https://yourdomain.com/.well-known/pay.json.

Specification (v1.0)

Required fields

Optional fields

Example

Pricing rules

Rules are evaluated top-to-bottom. First match wins.

Glob patterns

Special values

  • "0" or "0.00" — explicitly free
  • No matching rule — path is free
  • No pay.json file — entire site is free

Validation

Validates JSON syntax, schema compliance, and lints for rule ordering issues (e.g., wildcard rules that shadow more specific rules).

Discovery priority

Agents should discover pricing in this order:
  1. pay.json at /.well-known/pay.json — most authoritative
  2. Meta tag <meta name="x402" content="supported"> — fallback
  3. HTTP 402 response — server returns payment instructions
  4. Free — no pricing signals found
Agents must not combine pricing from multiple sources.

npm package

Source: github.com/xenarch-ai/pay-json