{"uid":"cap_i6cFvQeWlE7rpqJC6rH2v","slug":"format-openverbs-com-canonicalize-36118b29","name":"format.openverbs.com Canonicalize","description":"Parse a document (in any format) and re-emit it in the RFC 8785 JSON Canonicalization Scheme form — sorted keys, canonical number/string formatting — plus the SHA-256 of the canonical bytes for stable hashing, signing and dedup.","url":"https://format.openverbs.com/v1/canonicalize","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["data"],"properties":{"data":{"type":"string","maxLength":1000000,"minLength":1,"description":"The document to canonicalize, as a string in the `from` format."},"from":{"enum":["json","json5","jsonc","yaml","xml","csv","tsv","toml","ndjson","ini","env","properties","plist","querystring"],"type":"string","description":"Source format of `data`. Default json."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xhsCR-I7pMGTbiPtyaEKp","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses a document in any supported format and re-emits it as RFC 8785 JSON Canonicalization Scheme output with a SHA-256 hash for stable signing, hashing, and deduplication.","exampleAgentPrompt":"Take this YAML config and give me the RFC 8785 canonical JSON form with its SHA-256 hash so I can use it for signing: `name: acme\\nversion: 1.2.3\\nenabled: true`.","exampleUseCases":[{"title":"Stable hash for config deduplication","prompt":"I have this TOML config file and I need a stable SHA-256 hash of it so I can detect duplicates across environments — can you canonicalize it and give me the hash? Here's the content: `[server]\\nhost = \"localhost\"\\nport = 8080`."},{"title":"Prepare document for cryptographic signing","prompt":"Before I sign this JSON payload I need it in RFC 8785 canonical form with sorted keys and normalized numbers — can you canonicalize this for me: `{\"z\":1,\"a\":\"hello\",\"m\":3.0}`?"},{"title":"Cross-format content fingerprinting","prompt":"I have the same data represented as XML and as JSON and I want to verify they're semantically identical — can you canonicalize both to RFC 8785 and compare their SHA-256 hashes?"}],"resultDescription":"Returns the input document re-emitted as RFC 8785 JSON Canonicalization Scheme bytes — keys sorted lexicographically, numbers and strings in canonical form — along with the SHA-256 digest of those canonical bytes, suitable for use in digital signatures, content addressing, or deduplication pipelines.","failureModes":["Invalid or unparseable input document returns a parse error indicating the detected format issue","Input exceeds 1,000,000 character limit returns a payload-too-large error","Unrecognized or ambiguous source format with no `from` hint may cause a format detection failure","Malformed JSON5 or JSONC (e.g. unclosed comments) causes a parse error","Payment not provided or insufficient USDC causes a 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, cryptographically stable representation of a structured document — especially for digital signing, content-addressable storage, or deduplication across format variants. It uniquely supports ingesting 13+ source formats (YAML, XML, TOML, CSV, INI, etc.) and emitting RFC 8785-compliant canonical JSON with an attached SHA-256, avoiding the need to chain a separate parser and hasher.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:30:23.759Z","isFirstParty":false}