JSON Canon

Small, deterministic utilities for agents, paid per call with x402 in USDC on Base (eip155:8453). No account, no API key, no subscription. Unpaid requests return HTTP 402 with a Payment-Required challenge; failed calls (4xx) are not charged.

Tools and prices (USDC)

RouteWhat it doesPrice
GET | POST /v1/validateValidate + canonicalize JSON0.01
POST /v1/csv-to-jsonCSV to JSON with type inference0.01
POST /v1/json-diffJSON diff (RFC 6902 patch)0.01
POST /v1/json-patchApply JSON Patch (RFC 6902)0.01
POST /v1/pdf-textPDF text extraction0.02
POST /v1/pdf-tablesPDF table extraction0.04
GET | POST /v1/mx/rfcValidate Mexican RFC (SAT)0.01
GET | POST /v1/mx/curpValidate Mexican CURP (RENAPO)0.01
GET | POST /v1/mx/clabeValidate Mexican CLABE (SPEI)0.01
AssetUSDC on Base (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
Pay to0x4a850515EfAad14b1c3dBD9288828076683b0b95
FacilitatorPayAI

Remote MCP server

Streamable HTTP at https://json-canon-x402.fly.dev/mcp. Every tool above is an MCP tool; get_pricing is free. Paid tools follow the x402 MCP transport: without _meta["x402/payment"] they return the x402 challenge in structuredContent.

{
  "mcpServers": {
    "json-canon": {
      "url": "https://json-canon-x402.fly.dev/mcp"
    }
  }
}

Claude Code: claude mcp add --transport http json-canon https://json-canon-x402.fly.dev/mcp. Cursor: add the JSON above to ~/.cursor/mcp.json.

Usage

Validate + canonicalize JSON — 0.01 USDC

Validate a JSON instance against an optional JSON Schema and return RFC 8785 canonical JSON plus SHA-256.

curl -i -X POST https://json-canon-x402.fly.dev/v1/validate -H 'content-type: application/json' -d '{"instance":{"total":"10.00","items":[{"qty":2,"price":"5.00"}]},"schema":{"type":"object","required":["total","items"],"properties":{"total":{"type":"string"},"items":{"type":"array"}}},"canonicalize":true}'

CSV to JSON with type inference — 0.01 USDC

Convert CSV to JSON rows with per-column type inference (integer, number, boolean, null, string), delimiter auto-detection and a generated JSON Schema. Leading-zero codes (ZIP, CLABE) stay strings.

curl -i -X POST https://json-canon-x402.fly.dev/v1/csv-to-json -H 'content-type: application/json' -d '{"csv":"sku,qty,price,active,zip\nA-1,10,2.50,true,01234\nB-2,5,1.25,false,"}'

JSON diff (RFC 6902 patch) — 0.01 USDC

Compare two JSON documents and return the RFC 6902 JSON Patch that turns source into target, plus canonical SHA-256 of each side.

curl -i -X POST https://json-canon-x402.fly.dev/v1/json-diff -H 'content-type: application/json' -d '{"source":{"name":"Ana","tags":["a"],"age":30},"target":{"name":"Ana","tags":["a","b"],"city":"CDMX"}}'

Apply JSON Patch (RFC 6902) — 0.01 USDC

Apply an RFC 6902 JSON Patch to a JSON document and return the result and its canonical SHA-256. Failed 'test' ops return 409 and are not charged.

curl -i -X POST https://json-canon-x402.fly.dev/v1/json-patch -H 'content-type: application/json' -d '{"document":{"name":"Ana","tags":["a"]},"patch":[{"op":"add","path":"/tags/-","value":"b"},{"op":"replace","path":"/name","value":"Ana R."}]}'

PDF text extraction — 0.02 USDC

Extract text per page from a PDF given by public URL or base64 (max 4 MiB, 100 pages). No OCR: scanned PDFs are flagged as likely_scanned.

curl -i -X POST https://json-canon-x402.fly.dev/v1/pdf-text -H 'content-type: application/json' -d '{"url":"https://json-canon-x402.fly.dev/samples/invoice.pdf"}'

PDF table extraction — 0.04 USDC

Extract tables (rows and header-keyed records) from a PDF given by public URL or base64 (max 4 MiB, 30 pages). 'lines' strategy for ruled tables, 'text' for whitespace-aligned ones.

curl -i -X POST https://json-canon-x402.fly.dev/v1/pdf-tables -H 'content-type: application/json' -d '{"url":"https://json-canon-x402.fly.dev/samples/invoice.pdf"}'

Validate Mexican RFC (SAT) — 0.01 USDC

Validate a Mexican RFC tax ID (persona física or moral): format, embedded date, homoclave and SAT check digit. Offline; does not query SAT.

curl -i -X POST https://json-canon-x402.fly.dev/v1/mx/rfc -H 'content-type: application/json' -d '{"value":"SAT970701NN3"}'

Validate Mexican CURP (RENAPO) — 0.01 USDC

Validate a Mexican CURP: format, birth date, sex, state code, internal consonants and RENAPO check digit. Offline; does not query RENAPO.

curl -i -X POST https://json-canon-x402.fly.dev/v1/mx/curp -H 'content-type: application/json' -d '{"value":"BOXW310820HNERXN09"}'

Validate Mexican CLABE (SPEI) — 0.01 USDC

Validate an 18-digit Mexican CLABE bank account: SPEI bank code (with bank name), plaza, account and check digit. Offline; does not confirm the account exists.

curl -i -X POST https://json-canon-x402.fly.dev/v1/mx/clabe -H 'content-type: application/json' -d '{"value":"002010077777777771"}'

Free endpoints

JSON Canon 0.2.0. No signup. Pay per call.