{"openapi":"3.1.0","info":{"title":"JSON Canon","description":"JSON Canon validates a JSON instance against a JSON Schema and returns the RFC 8785 (JCS) canonical form plus its SHA-256 digest. Agents use it to compare or persist JSON deterministically. The paid route is GET or POST /v1/validate, at 0.01 USDC on Base (eip155:8453) via x402. Unpaid calls return HTTP 402 with a Payment-Required challenge. Free documentation lives at /, /llms.txt, /openapi.json, /v1/example and /health. Also: CSV to JSON, JSON diff/patch (RFC 6902), PDF text/tables, Mexican RFC/CURP/CLABE validation, and a remote MCP server at /mcp.","version":"0.2.0","x-guidance":"Call POST /v1/validate with JSON body {instance, schema?, canonicalize?} after paying $0.01 USDC on Base via x402. Unpaid calls return HTTP 402 and a Payment-Required header; retry with PAYMENT-SIGNATURE. GET /v1/validate accepts the same fields as query parameters (instance must be JSON-encoded). Other paid tools (JSON body, POST): /v1/validate = 0.01 USDC; /v1/csv-to-json = 0.01 USDC; /v1/json-diff = 0.01 USDC; /v1/json-patch = 0.01 USDC; /v1/pdf-text = 0.02 USDC; /v1/pdf-tables = 0.04 USDC; /v1/mx/rfc = 0.01 USDC; /v1/mx/curp = 0.01 USDC; /v1/mx/clabe = 0.01 USDC. /v1/mx/* also accept GET ?value=. 4xx responses are not charged. GET /, /llms.txt, /openapi.json, /v1/example, /health, /metrics and /.well-known/x402 are free. MCP (Streamable HTTP): POST /mcp."},"paths":{"/":{"get":{"summary":"Human-readable landing page (usage and prices).","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[],"tags":["Free"]}},"/llms.txt":{"get":{"summary":"Plain-text summary for language models and agents.","operationId":"llms_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}},"security":[],"tags":["Free"]}},"/health":{"get":{"summary":"Liveness and payment configuration.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}},"security":[],"tags":["Free"]}},"/v1/example":{"get":{"summary":"Free sample requests and responses for every tool.","operationId":"example_v1_example_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Example V1 Example Get"}}}}},"security":[],"tags":["Free"]}},"/metrics":{"get":{"summary":"Request counters since last process start (ephemeral).","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Metrics Metrics Get"}}}}},"security":[],"tags":["Free"]}},"/.well-known/x402":{"get":{"summary":"x402 discovery document (compatibility).","operationId":"well_known__well_known_x402_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Well Known  Well Known X402 Get"}}}}},"security":[],"tags":["Free"]}},"/.well-known/x402.json":{"get":{"summary":"Alias of /.well-known/x402.","operationId":"well_known_json__well_known_x402_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Well Known Json  Well Known X402 Json Get"}}}}},"security":[],"tags":["Free"]}},"/.well-known/mcp/server-card.json":{"get":{"summary":"MCP server card (tools, transport, payments).","operationId":"mcp_card__well_known_mcp_server_card_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mcp Card  Well Known Mcp Server Card Json Get"}}}}},"security":[],"tags":["Free"]}},"/samples/invoice.pdf":{"get":{"summary":"Sample PDF for trying the PDF tools.","operationId":"sample_pdf_samples_invoice_pdf_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[],"tags":["Free"]}},"/v1/validate":{"get":{"summary":"Validate JSON (query, paid)","description":"Validate a JSON instance against an optional JSON Schema and return RFC 8785 canonical JSON plus SHA-256. Price: 0.01 USDC on Base via x402.","operationId":"validateJsonGet","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateResponse"},"examples":{"ok":{"value":{"valid":true,"errors":[],"canonical":"{\"items\":[{\"price\":\"5.00\",\"qty\":2}],\"total\":\"10.00\"}","sha256":"a5f41d83fa6b2add743d818140bec00a7a4bc5ce02aed71182488be27f189547","bytes":52}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"parameters":[{"name":"instance","in":"query","required":true,"description":"JSON-encoded instance to validate","schema":{"type":"string"},"example":"{\"total\":\"10.00\",\"items\":[{\"qty\":2,\"price\":\"5.00\"}]}"},{"name":"schema","in":"query","required":false,"description":"JSON-encoded JSON Schema (optional)","schema":{"type":"string"},"example":"{\"type\":\"object\",\"required\":[\"total\",\"items\"],\"properties\":{\"total\":{\"type\":\"string\"},\"items\":{\"type\":\"array\"}}}"},{"name":"canonicalize","in":"query","required":false,"description":"Default true","schema":{"type":"string","enum":["true","false"]},"example":"true"}]},"post":{"summary":"Validate JSON (body, paid)","description":"Validate a JSON instance against an optional JSON Schema and return RFC 8785 canonical JSON plus SHA-256. Price: 0.01 USDC on Base via x402.","operationId":"validateJsonPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateResponse"},"examples":{"ok":{"value":{"valid":true,"errors":[],"canonical":"{\"items\":[{\"price\":\"5.00\",\"qty\":2}],\"total\":\"10.00\"}","sha256":"a5f41d83fa6b2add743d818140bec00a7a4bc5ce02aed71182488be27f189547","bytes":52}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRequest"},"examples":{"example":{"summary":"Validate + canonicalize JSON","value":{"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}}}}}}}},"/v1/csv-to-json":{"post":{"summary":"CSV to JSON with type inference","description":"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. Price: 0.01 USDC on Base via x402.","operationId":"csvToJsonPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvToJsonResponse"},"examples":{"ok":{"value":{"columns":[{"name":"sku","type":"string"},{"name":"qty","type":"integer"},{"name":"price","type":"number"},{"name":"active","type":"boolean"},{"name":"zip","type":"string"}],"rows":[{"sku":"A-1","qty":10,"price":2.5,"active":true,"zip":"01234"},{"sku":"B-2","qty":5,"price":1.25,"active":false,"zip":null}],"row_count":2,"delimiter":",","header":true,"output":"objects","warnings":[]}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvToJsonRequest"},"examples":{"example":{"summary":"CSV to JSON with type inference","value":{"csv":"sku,qty,price,active,zip\nA-1,10,2.50,true,01234\nB-2,5,1.25,false,"}}}}}}}},"/v1/json-diff":{"post":{"summary":"JSON diff (RFC 6902 patch)","description":"Compare two JSON documents and return the RFC 6902 JSON Patch that turns source into target, plus canonical SHA-256 of each side. Price: 0.01 USDC on Base via x402.","operationId":"jsonDiffPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonDiffResponse"},"examples":{"ok":{"value":{"equal":false,"patch":[{"op":"remove","path":"/age"},{"op":"add","path":"/city","value":"CDMX"},{"op":"add","path":"/tags/1","value":"b"}],"operation_count":3,"operations_by_type":{"remove":1,"add":2},"source_sha256":"f0cec6d5599fbef45ae877a8a52e5fbdcd8852d7b7606da7711670ac59edb0af","target_sha256":"f813c9b470309ce79a4217746b45b6a39a7f269519e420936b3f8af89a482e2e","media_type":"application/json-patch+json"}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonDiffRequest"},"examples":{"example":{"summary":"JSON diff (RFC 6902 patch)","value":{"source":{"name":"Ana","tags":["a"],"age":30},"target":{"name":"Ana","tags":["a","b"],"city":"CDMX"}}}}}}}}},"/v1/json-patch":{"post":{"summary":"Apply JSON Patch (RFC 6902)","description":"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. Price: 0.01 USDC on Base via x402.","operationId":"jsonPatchPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonPatchResponse"},"examples":{"ok":{"value":{"result":{"name":"Ana R.","tags":["a","b"]},"operation_count":2,"sha256":"d69237f38becabc7c60e755fd7050f3f963b872ac23029ada315c9ecdb4c2f78"}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonPatchRequest"},"examples":{"example":{"summary":"Apply JSON Patch (RFC 6902)","value":{"document":{"name":"Ana","tags":["a"]},"patch":[{"op":"add","path":"/tags/-","value":"b"},{"op":"replace","path":"/name","value":"Ana R."}]}}}}}}}},"/v1/pdf-text":{"post":{"summary":"PDF text extraction","description":"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. Price: 0.02 USDC on Base via x402.","operationId":"pdfTextPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfTextResponse"},"examples":{"ok":{"value":{"page_count":1,"pages":[{"page":1,"text":"Factura de prueba 1\nCliente: ACME SA de CV. Total: 1,234.50 MXN\nSKU\n...","chars":157}],"total_chars":157,"likely_scanned":false,"pages_truncated":false}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfTextRequest"},"examples":{"example":{"summary":"PDF text extraction","value":{"url":"https://json-canon-x402.fly.dev/samples/invoice.pdf"}}}}}}}},"/v1/pdf-tables":{"post":{"summary":"PDF table extraction","description":"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. Price: 0.04 USDC on Base via x402.","operationId":"pdfTablesPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfTablesResponse"},"examples":{"ok":{"value":{"page_count":1,"table_count":1,"tables":[{"page":1,"index":0,"rows":[["SKU","Descripcion","Cantidad","Precio"],["A-1","Tornillo","10","2.50"]],"records":[{"SKU":"A-1","Descripcion":"Tornillo","Cantidad":"10","Precio":"2.50"}]}],"pages_truncated":false}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfTablesRequest"},"examples":{"example":{"summary":"PDF table extraction","value":{"url":"https://json-canon-x402.fly.dev/samples/invoice.pdf"}}}}}}}},"/v1/mx/rfc":{"get":{"summary":"Validate Mexican RFC (SAT)","description":"Validate a Mexican RFC tax ID (persona física or moral): format, embedded date, homoclave and SAT check digit. Offline; does not query SAT. Price: 0.01 USDC on Base via x402.","operationId":"mxRfcGet","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxRfcResponse"},"examples":{"ok":{"value":{"type":"rfc","input":"SAT970701NN3","normalized":"SAT970701NN3","valid":true,"errors":[],"details":{"person_type":"moral","name_letters":"SAT","homoclave":"NN3","date":"1997-07-01","date_meaning":"incorporation date"},"check_digit":{"expected":"3","actual":"3","valid":true}}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"parameters":[{"name":"value","in":"query","required":true,"description":"Identifier to check","schema":{"type":"string"},"example":"SAT970701NN3"}]},"post":{"summary":"Validate Mexican RFC (SAT)","description":"Validate a Mexican RFC tax ID (persona física or moral): format, embedded date, homoclave and SAT check digit. Offline; does not query SAT. Price: 0.01 USDC on Base via x402.","operationId":"mxRfcPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxRfcResponse"},"examples":{"ok":{"value":{"type":"rfc","input":"SAT970701NN3","normalized":"SAT970701NN3","valid":true,"errors":[],"details":{"person_type":"moral","name_letters":"SAT","homoclave":"NN3","date":"1997-07-01","date_meaning":"incorporation date"},"check_digit":{"expected":"3","actual":"3","valid":true}}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxRfcRequest"},"examples":{"example":{"summary":"Validate Mexican RFC (SAT)","value":{"value":"SAT970701NN3"}}}}}}}},"/v1/mx/curp":{"get":{"summary":"Validate Mexican CURP (RENAPO)","description":"Validate a Mexican CURP: format, birth date, sex, state code, internal consonants and RENAPO check digit. Offline; does not query RENAPO. Price: 0.01 USDC on Base via x402.","operationId":"mxCurpGet","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxCurpResponse"},"examples":{"ok":{"value":{"type":"curp","input":"BOXW310820HNERXN09","normalized":"BOXW310820HNERXN09","valid":true,"errors":[],"details":{"birth_date":"1931-08-20","sex":"male (hombre)","state_code":"NE","state":"Born abroad (Nacido en el extranjero)","name_letters":"BOXW","internal_consonants":"RXN","century_hint":"born before 2000"},"check_digit":{"expected":"9","actual":"9","valid":true}}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"parameters":[{"name":"value","in":"query","required":true,"description":"Identifier to check","schema":{"type":"string"},"example":"BOXW310820HNERXN09"}]},"post":{"summary":"Validate Mexican CURP (RENAPO)","description":"Validate a Mexican CURP: format, birth date, sex, state code, internal consonants and RENAPO check digit. Offline; does not query RENAPO. Price: 0.01 USDC on Base via x402.","operationId":"mxCurpPost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxCurpResponse"},"examples":{"ok":{"value":{"type":"curp","input":"BOXW310820HNERXN09","normalized":"BOXW310820HNERXN09","valid":true,"errors":[],"details":{"birth_date":"1931-08-20","sex":"male (hombre)","state_code":"NE","state":"Born abroad (Nacido en el extranjero)","name_letters":"BOXW","internal_consonants":"RXN","century_hint":"born before 2000"},"check_digit":{"expected":"9","actual":"9","valid":true}}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxCurpRequest"},"examples":{"example":{"summary":"Validate Mexican CURP (RENAPO)","value":{"value":"BOXW310820HNERXN09"}}}}}}}},"/v1/mx/clabe":{"get":{"summary":"Validate Mexican CLABE (SPEI)","description":"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. Price: 0.01 USDC on Base via x402.","operationId":"mxClabeGet","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxClabeResponse"},"examples":{"ok":{"value":{"type":"clabe","input":"002010077777777771","normalized":"002010077777777771","valid":true,"errors":[],"details":{"bank_code":"002","bank_name":"Banamex","plaza_code":"010","account_number":"07777777777"},"check_digit":{"expected":"1","actual":"1","valid":true}}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"parameters":[{"name":"value","in":"query","required":true,"description":"Identifier to check","schema":{"type":"string"},"example":"002010077777777771"}]},"post":{"summary":"Validate Mexican CLABE (SPEI)","description":"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. Price: 0.01 USDC on Base via x402.","operationId":"mxClabePost","responses":{"200":{"description":"Result after a settled x402 payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxClabeResponse"},"examples":{"ok":{"value":{"type":"clabe","input":"002010077777777771","normalized":"002010077777777771","valid":true,"errors":[],"details":{"bank_code":"002","bank_name":"Banamex","plaza_code":"010","account_number":"07777777777"},"check_digit":{"expected":"1","actual":"1","valid":true}}}}}}},"402":{"description":"Payment Required. x402 challenge is in the Payment-Required header (Base64 JSON) and may also appear in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (not charged)."},"413":{"description":"Input too large (not charged)."}},"tags":["Paid"],"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MxClabeRequest"},"examples":{"example":{"summary":"Validate Mexican CLABE (SPEI)","value":{"value":"002010077777777771"}}}}}}}}},"servers":[{"url":"https://json-canon-x402.fly.dev","description":"JSON Canon public origin"}],"tags":[{"name":"Paid","description":"x402-paid tools (USDC on Base)"},{"name":"Free","description":"Documentation, health and discovery"}],"components":{"schemas":{"ValidateRequest":{"type":"object","required":["instance"],"additionalProperties":false,"properties":{"instance":{"description":"JSON value to validate. Any JSON type is accepted."},"schema":{"type":"object","additionalProperties":true,"description":"JSON Schema to validate instance against. Optional. If omitted, the instance is accepted and only canonicalized."},"canonicalize":{"type":"boolean","default":true,"description":"If true (default), return RFC 8785 JCS canonical JSON, its SHA-256 hex digest, and byte length."}}},"ValidateResponse":{"type":"object","required":["valid","errors"],"properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"validator":{"type":"string"}}},"description":"Empty when valid is true."},"canonical":{"type":"string","description":"RFC 8785 canonical JSON, present when canonicalize is true."},"sha256":{"type":"string","description":"SHA-256 hex digest of the canonical JSON."},"bytes":{"type":"integer","description":"Byte length of the canonical JSON."},"x402":{"type":"object","properties":{"protected":{"type":"boolean"},"facilitator_label":{"type":"string"},"settled_onchain":{"type":"boolean"}}}}},"CsvToJsonRequest":{"type":"object","properties":{"csv":{"type":"string","description":"CSV text (UTF-8). Max 1 MiB, 20,000 rows, 512 columns."},"csv_base64":{"type":"string","description":"Alternative to 'csv': base64 bytes (UTF-8 or Latin-1)."},"delimiter":{"type":"string","minLength":1,"maxLength":1,"description":"Auto-detected among , ; TAB | if omitted."},"header":{"type":"boolean","default":true,"description":"First row holds column names."},"infer_types":{"type":"boolean","default":true,"description":"Infer integer/number/boolean/null per column."},"parse_booleans":{"type":"boolean","default":true,"description":"Map true/false/yes/no/si to booleans."},"null_values":{"type":"array","items":{"type":"string"},"description":"Strings treated as null (empty is always null)."},"output":{"type":"string","enum":["objects","arrays"],"default":"objects"}},"required":[],"additionalProperties":false},"CsvToJsonResponse":{"type":"object","required":["columns","rows","row_count"],"properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}}}},"rows":{"type":"array"},"row_count":{"type":"integer"},"delimiter":{"type":"string"},"json_schema":{"type":"object"},"warnings":{"type":"array","items":{"type":"string"}}}},"JsonDiffRequest":{"type":"object","properties":{"source":{"description":"Original JSON value (any type)."},"target":{"description":"New JSON value (any type)."}},"required":["source","target"],"additionalProperties":false},"JsonDiffResponse":{"type":"object","required":["equal","patch"],"properties":{"equal":{"type":"boolean","description":"True if RFC 8785 canonical forms match."},"patch":{"type":"array","description":"RFC 6902 operations that turn source into target."},"operation_count":{"type":"integer"},"operations_by_type":{"type":"object"},"source_sha256":{"type":"string"},"target_sha256":{"type":"string"}}},"JsonPatchRequest":{"type":"object","properties":{"document":{"description":"JSON value to patch (any type)."},"patch":{"type":"array","description":"RFC 6902 operations (add, remove, replace, move, copy, test). Max 10,000.","items":{"type":"object","required":["op","path"],"properties":{"op":{"type":"string"},"path":{"type":"string"},"from":{"type":"string"},"value":{}}}}},"required":["document","patch"],"additionalProperties":false},"JsonPatchResponse":{"type":"object","required":["result"],"properties":{"result":{"description":"Patched document."},"operation_count":{"type":"integer"},"sha256":{"type":"string"}}},"PdfTextRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public http(s) URL of the PDF (max 4 MiB, 3 redirects, public IPs only)."},"pdf_base64":{"type":"string","description":"Alternative to 'url': base64 PDF bytes (max 4 MiB decoded)."},"pages":{"type":"array","items":{"type":"integer","minimum":1},"description":"1-based pages to read. Default: all (up to max_pages)."},"max_pages":{"type":"integer","minimum":1,"maximum":100,"default":100},"joined":{"type":"boolean","default":true,"description":"Also return all pages joined in 'text'."}},"required":[],"additionalProperties":false},"PdfTextResponse":{"type":"object","required":["page_count","pages"],"properties":{"page_count":{"type":"integer"},"pages":{"type":"array","items":{"type":"object","properties":{"page":{"type":"integer"},"text":{"type":"string"},"chars":{"type":"integer"}}}},"text":{"type":["string","null"]},"total_chars":{"type":"integer"},"likely_scanned":{"type":"boolean"},"pages_truncated":{"type":"boolean"},"metadata":{"type":"object"}}},"PdfTablesRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public http(s) URL of the PDF (max 4 MiB, 3 redirects, public IPs only)."},"pdf_base64":{"type":"string","description":"Alternative to 'url': base64 PDF bytes (max 4 MiB decoded)."},"pages":{"type":"array","items":{"type":"integer","minimum":1},"description":"1-based pages to read. Default: all (up to max_pages)."},"max_pages":{"type":"integer","minimum":1,"maximum":30,"default":30},"strategy":{"type":"string","enum":["lines","text"],"default":"lines","description":"'lines' for ruled tables, 'text' for whitespace-aligned columns."},"header":{"type":"boolean","default":true,"description":"Also return rows as records keyed by the first row."},"include_text":{"type":"boolean","default":false,"description":"Also return page text."}},"required":[],"additionalProperties":false},"PdfTablesResponse":{"type":"object","required":["page_count","tables"],"properties":{"page_count":{"type":"integer"},"table_count":{"type":"integer"},"tables":{"type":"array","items":{"type":"object","properties":{"page":{"type":"integer"},"rows":{"type":"array"},"records":{"type":["array","null"]}}}},"pages_truncated":{"type":"boolean"}}},"MxRfcRequest":{"type":"object","properties":{"value":{"type":"string","description":"RFC (12 or 13 chars). Spaces, dashes and lowercase are normalized.","examples":["SAT970701NN3"]}},"required":["value"],"additionalProperties":false},"MxRfcResponse":{"type":"object","required":["valid","errors","normalized"],"properties":{"type":{"type":"string"},"normalized":{"type":"string"},"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"string"}},"details":{"type":"object"},"check_digit":{"type":["object","null"],"properties":{"expected":{"type":"string"},"actual":{"type":"string"},"valid":{"type":"boolean"}}},"notice":{"type":"string"}}},"MxCurpRequest":{"type":"object","properties":{"value":{"type":"string","description":"CURP (18 chars). Spaces, dashes and lowercase are normalized.","examples":["BOXW310820HNERXN09"]}},"required":["value"],"additionalProperties":false},"MxCurpResponse":{"type":"object","required":["valid","errors","normalized"],"properties":{"type":{"type":"string"},"normalized":{"type":"string"},"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"string"}},"details":{"type":"object"},"check_digit":{"type":["object","null"],"properties":{"expected":{"type":"string"},"actual":{"type":"string"},"valid":{"type":"boolean"}}},"notice":{"type":"string"}}},"MxClabeRequest":{"type":"object","properties":{"value":{"type":"string","description":"CLABE (18 digits). Spaces, dashes and lowercase are normalized.","examples":["002010077777777771"]}},"required":["value"],"additionalProperties":false},"MxClabeResponse":{"type":"object","required":["valid","errors","normalized"],"properties":{"type":{"type":"string"},"normalized":{"type":"string"},"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"string"}},"details":{"type":"object"},"check_digit":{"type":["object","null"],"properties":{"expected":{"type":"string"},"actual":{"type":"string"},"valid":{"type":"boolean"}}},"notice":{"type":"string"}}}}},"x-payment-info":{"protocols":[{"x402":{"version":2}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"network":"eip155:8453","asset":"USDC","payTo":"0x4a850515EfAad14b1c3dBD9288828076683b0b95"}}