{"openapi":"3.1.0","info":{"title":"dataforge","version":"1.0.0","summary":"Structured-data conversion, query, schema, transform and diff/patch.","description":"Deterministic conversion, JSONPath querying, JSON Schema draft 2020-12 inference and\nvalidation, a declarative transform pipeline, and RFC 6902 diff/patch across CSV, TSV,\nJSON, JSONL, YAML, TOML, XML, INI and Java properties.\n\nEvery POST route is metered with x402 v2 (USDC on Base, CAIP-2 `eip155:8453`). An unpaid\nrequest returns 402 with a base64 `PAYMENT-REQUIRED` challenge; any x402 client pays and\nretries. GET / , /health, /openapi.json, /formats and POST /detect are free.\n\nPrices: /convert $0.002, /query $0.002, /schema $0.003, /transform $0.003, /diff $0.002, /patch $0.002.\n\nFailed requests (4xx/5xx) are never settled, so bad input costs nothing.","license":{"name":"Proprietary","identifier":"LicenseRef-dataforge"}},"servers":[{"url":"https://dataforge.x.c00l.site"}],"tags":[{"name":"convert","description":"Format conversion"},{"name":"query","description":"JSONPath / JSON Pointer"},{"name":"schema","description":"JSON Schema inference and validation"},{"name":"transform","description":"Declarative reshaping"},{"name":"diff","description":"RFC 6902 diff and patch"},{"name":"meta","description":"Free metadata routes"}],"paths":{"/":{"get":{"tags":["meta"],"summary":"HTML landing page documenting every route and price. Free.","responses":{"200":{"description":"HTML","content":{"text/html":{}}}}}},"/health":{"get":{"tags":["meta"],"summary":"Liveness probe. Free.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":true},"service":{"type":"string"},"formats":{"type":"array","items":{"type":"string"}}}},"example":{"ok":true,"service":"dataforge","formats":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties"]}}}}}}},"/openapi.json":{"get":{"tags":["meta"],"summary":"This document. Free.","responses":{"200":{"description":"OpenAPI 3.1","content":{"application/json":{}}}}}},"/formats":{"get":{"tags":["meta"],"summary":"Supported formats, transform operations and the hard limits. Free.","responses":{"200":{"description":"Capabilities","content":{"application/json":{"schema":{"type":"object","properties":{"formats":{"type":"array","items":{"type":"string"}},"operations":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","additionalProperties":{"type":"integer"}}}}}}}}}},"/detect":{"post":{"tags":["meta"],"summary":"Sniff the format of a document. Free.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"string","maxLength":1048576}}},"example":{"data":"a,b\n1,2\n"}}}},"responses":{"200":{"description":"Detection result","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties"]},"confidence":{"type":"string","enum":["high","medium","low"]},"reason":{"type":"string"},"length":{"type":"integer"}}},"example":{"format":"csv","confidence":"high","reason":"consistent 2 comma-separated columns","length":8}}}},"400":{"description":"Format could not be determined, or the input was too large.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/convert":{"post":{"tags":["convert"],"summary":"Convert a document between formats. $0.002 per call.","description":"RFC 4180 CSV (quoted fields with embedded commas/newlines/quotes, BOM stripping, CRLF, ragged rows), YAML with anchors and block scalars, TOML v1.0.0, XML with attributes/CDATA/namespaces, INI and Java properties. `from:\"auto\"` sniffs the format and reports what it found.","x-price-usd":"$0.002","x-payment-protocol":"x402/v2","x-payment-network":"eip155:8453","x-payment-asset":"USDC","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","data"],"properties":{"from":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto"},"to":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties"]},"data":{"type":"string","maxLength":1048576},"options":{"type":"object","description":"Applied to both parse and serialise. CSV: delimiter (or \"auto\"), quote, header, trim, coerce (safe|none|aggressive), ragged (fill|error|truncate), nullValues, eol, quoteAll, bom. JSON: indent, sortKeys. YAML: indent, flow, flowLevel, sortKeys, multiDocument, duplicateKeys. TOML: nullPolicy. XML: root, attrPrefix, textKey, explicitArray, explicitRoot, preserveCdata, declaration, indent. INI/properties: nestSections, unflatten, separator.","additionalProperties":true},"fromOptions":{"type":"object","description":"Parser-only overrides.","additionalProperties":true},"toOptions":{"type":"object","description":"Serialiser-only overrides.","additionalProperties":true}}},"examples":{"csv to json":{"value":{"from":"csv","to":"json","data":"name,age\r\nAda,36\r\n\"Grace, R\",45\n"}},"auto-detect yaml to toml":{"value":{"from":"auto","to":"toml","data":"server:\n  host: localhost\n  port: 8080\n"}},"json to xml":{"value":{"from":"json","to":"xml","data":"{\"book\":{\"@isbn\":\"1\",\"title\":\"Dune\"}}"}}}}}},"responses":{"200":{"description":"Success. Settles $0.002 in USDC on Base.","content":{"application/json":{"schema":{"type":"object","required":["format","data","rows","warnings"],"properties":{"format":{"type":"string","description":"The output format."},"from":{"type":"string","description":"The input format actually used."},"data":{"type":"string","description":"The converted document."},"rows":{"type":"integer","description":"Array length, or 1 for a single object."},"detected":{"type":"object","description":"Present when from was \"auto\".","properties":{"format":{"type":"string"},"confidence":{"type":"string"},"reason":{"type":"string"}}},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-fatal notes: detected format, coercion decisions, dropped nulls, and so on."},"paidBy":{"type":["string","null"],"description":"Payer address, when the facilitator reports it."}}}}}},"400":{"description":"Malformed request, unparseable input, or a spec/schema error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"402":{"description":"Payment required. The `PAYMENT-REQUIRED` response header carries the base64 x402 v2 challenge.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired object.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Input or output over the size cap. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"500":{"description":"Internal error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"502":{"description":"The payment facilitator was unreachable. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/query":{"post":{"tags":["query"],"summary":"Query a document with JSONPath or a JSON Pointer. $0.002 per call.","description":"JSONPath: `$`, `.name`, `['name']`, `.*`, `[*]`, recursive descent `..`, `[0]`, `[-1]`, unions `[0,2]`, slices `[1:5:2]` and `[::-1]`, filters `[?(@.price<10 && @.tag=='x')]`, existence `[?(@.isbn)]`, computed index `[(@.length-1)]`. Filter expressions support == != < <= > >= =~ && || !, `in`/`nin`/`contains`, and the functions length, count, abs, floor, ceil, round, lower, upper, trim, type, keys, values, number, string, contains, startsWith, endsWith, match, min, max. Nothing is eval'd.","x-price-usd":"$0.002","x-payment-protocol":"x402/v2","x-payment-network":"eip155:8453","x-payment-asset":"USDC","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["data","path"],"properties":{"from":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto"},"data":{"description":"A document string, or an already-structured JSON value.","oneOf":[{"type":"string","maxLength":1048576},{"type":"object"},{"type":"array"}]},"path":{"type":"string","maxLength":2000},"syntax":{"type":"string","enum":["jsonpath","pointer"],"default":"jsonpath"},"limit":{"type":"integer","minimum":1,"maximum":20000},"pathStyle":{"type":"string","enum":["dot","bracket"],"default":"dot"},"to":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties"],"description":"Also serialise the matches into this format."},"options":{"type":"object","additionalProperties":true}}},"examples":{"filter on price":{"value":{"from":"json","data":"{\"store\":{\"book\":[{\"author\":\"Rees\",\"price\":8.95},{\"author\":\"Waugh\",\"price\":12.99}]}}","path":"$.store.book[?(@.price < 10)].author"}},"recursive descent over yaml":{"value":{"from":"yaml","data":"a:\n  b:\n    c: 1\n  d:\n    c: 2\n","path":"$..c"}},"json pointer":{"value":{"from":"json","data":"{\"a\":{\"b\":[1,2,3]}}","path":"/a/b/1","syntax":"pointer"}}}}}},"responses":{"200":{"description":"Success. Settles $0.002 in USDC on Base.","content":{"application/json":{"schema":{"type":"object","required":["count","matches","paths"],"properties":{"syntax":{"type":"string"},"from":{"type":"string"},"path":{"type":"string"},"count":{"type":"integer"},"total":{"type":"integer","description":"Matches before `limit` was applied."},"truncated":{"type":"boolean"},"matches":{"type":"array","items":{}},"paths":{"type":"array","items":{"type":"string"},"description":"Normalised JSONPath of each match."},"pointers":{"type":"array","items":{"type":"string"},"description":"RFC 6901 pointer of each match."},"format":{"type":"string"},"data":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-fatal notes: detected format, coercion decisions, dropped nulls, and so on."}}}}}},"400":{"description":"Malformed request, unparseable input, or a spec/schema error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"402":{"description":"Payment required. The `PAYMENT-REQUIRED` response header carries the base64 x402 v2 challenge.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired object.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Input or output over the size cap. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"500":{"description":"Internal error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"502":{"description":"The payment facilitator was unreachable. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/schema":{"post":{"tags":["schema"],"summary":"Infer a JSON Schema, or validate against one. $0.003 per call.","description":"Without `validate`, infers a draft 2020-12 schema: array elements are merged, a property is `required` only when present in every sample, enums appear when a field has few repeated distinct values, `integer` and `number` are distinguished, nullability becomes a type union, and string `format` is emitted when every sample matches (date-time, date, time, uuid, email, ipv4, ipv6, uri, hostname). With `validate`, checks the data and returns one error per failure with a JSON Pointer `instancePath`, the `schemaPath` and the failing `keyword`. Only local `#/...` $refs resolve; remote schemas are never fetched.","x-price-usd":"$0.003","x-payment-protocol":"x402/v2","x-payment-network":"eip155:8453","x-payment-asset":"USDC","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"from":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto"},"data":{"oneOf":[{"type":"string","maxLength":1048576},{"type":"object"},{"type":"array"}]},"validate":{"description":"A JSON Schema. Supplying it switches to validation mode.","oneOf":[{"type":"object"},{"type":"boolean"}]},"options":{"type":"object","properties":{"enumThreshold":{"type":"integer","default":12},"enumMinSamples":{"type":"integer","default":3},"detectFormats":{"type":"boolean","default":true},"ranges":{"type":"boolean","default":false},"stringLengths":{"type":"boolean","default":false},"additionalProperties":{"type":"boolean","default":true},"examples":{"type":"boolean","default":false},"title":{"type":"string"},"assertFormat":{"type":"boolean","default":true,"description":"JSON Schema treats `format` as an annotation; this service asserts it by default. Set false for spec-only behaviour."}},"additionalProperties":true}}},"examples":{"infer":{"value":{"from":"json","data":"[{\"id\":1,\"email\":\"a@b.com\",\"tier\":\"pro\"},{\"id\":2,\"email\":\"c@d.io\",\"tier\":\"free\"}]"}},"validate":{"value":{"from":"json","data":"{\"id\":\"x\"}","validate":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]}}}}}}},"responses":{"200":{"description":"Success. Settles $0.003 in USDC on Base.","content":{"application/json":{"schema":{"type":"object","oneOf":[{"type":"object","required":["mode","schema"],"properties":{"mode":{"type":"string","const":"infer"},"from":{"type":"string"},"schema":{"type":"object"},"stats":{"type":"object","properties":{"samples":{"type":"integer"},"properties":{"type":"integer"}}},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-fatal notes: detected format, coercion decisions, dropped nulls, and so on."}}},{"type":"object","required":["mode","valid","errors"],"properties":{"mode":{"type":"string","const":"validate"},"valid":{"type":"boolean"},"errorCount":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","properties":{"instancePath":{"type":"string","description":"RFC 6901 pointer to the offending value."},"schemaPath":{"type":"string"},"keyword":{"type":"string"},"message":{"type":"string"}}}},"truncated":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-fatal notes: detected format, coercion decisions, dropped nulls, and so on."}}}]}}}},"400":{"description":"Malformed request, unparseable input, or a spec/schema error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"402":{"description":"Payment required. The `PAYMENT-REQUIRED` response header carries the base64 x402 v2 challenge.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired object.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Input or output over the size cap. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"500":{"description":"Internal error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"502":{"description":"The payment facilitator was unreachable. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/transform":{"post":{"tags":["transform"],"summary":"Reshape data with a declarative pipeline. $0.003 per call.","description":"Operations, applied in order: select, drop, rename, filter, compute, cast, sort, groupBy, flatten, unflatten, pivot, unpivot, dedupe, limit, offset. `filter` takes a predicate object ({field, op, value} with and/or/not) or an expression string. `groupBy` aggregations: count, countDistinct, sum, avg, min, max, first, last, join, list. `compute` derives fields from an expression. Nothing is eval'd — expressions are parsed and interpreted.","x-price-usd":"$0.003","x-payment-protocol":"x402/v2","x-payment-network":"eip155:8453","x-payment-asset":"USDC","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["data","pipeline"],"properties":{"from":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto"},"to":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties"],"default":"json"},"data":{"oneOf":[{"type":"string","maxLength":1048576},{"type":"object"},{"type":"array"}]},"pipeline":{"type":"array","minItems":1,"maxItems":64,"items":{"type":"object","required":["op"],"properties":{"op":{"type":"string","enum":["select","drop","rename","filter","compute","cast","sort","groupBy","flatten","unflatten","pivot","unpivot","dedupe","limit","offset"]}},"additionalProperties":true}},"options":{"type":"object","properties":{"rowsFrom":{"type":"string","description":"JSONPath selecting the rows out of a wrapper document, e.g. $.data.items[*]."}},"additionalProperties":true},"toOptions":{"type":"object","additionalProperties":true}}},"examples":{"group and sort":{"value":{"from":"csv","to":"csv","data":"dept,name,salary\neng,Ada,120\neng,Alan,110\nops,Grace,100\n","pipeline":[{"op":"groupBy","by":["dept"],"aggregations":{"headcount":"count","total":"sum:salary"}},{"op":"sort","by":["-total"]}]}},"flatten nested json for a spreadsheet":{"value":{"from":"json","to":"csv","data":"[{\"id\":1,\"user\":{\"name\":\"Ada\",\"tags\":[\"x\",\"y\"]}}]","pipeline":[{"op":"flatten"}]}},"filter with an expression":{"value":{"from":"json","data":"[{\"p\":5},{\"p\":15}]","pipeline":[{"op":"filter","where":"p < 10"}]}}}}}},"responses":{"200":{"description":"Success. Settles $0.003 in USDC on Base.","content":{"application/json":{"schema":{"type":"object","required":["rows","format"],"properties":{"from":{"type":"string"},"format":{"type":"string"},"rows":{"type":"integer"},"columns":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","description":"Row counts in and out of each pipeline step.","items":{"type":"object","properties":{"op":{"type":"string"},"rowsIn":{"type":"integer"},"rowsOut":{"type":"integer"}}}},"data":{"description":"An array of records when format is json, otherwise the serialised text.","oneOf":[{"type":"array"},{"type":"string"}]},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-fatal notes: detected format, coercion decisions, dropped nulls, and so on."}}}}}},"400":{"description":"Malformed request, unparseable input, or a spec/schema error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"402":{"description":"Payment required. The `PAYMENT-REQUIRED` response header carries the base64 x402 v2 challenge.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired object.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Input or output over the size cap. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"500":{"description":"Internal error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"502":{"description":"The payment facilitator was unreachable. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/diff":{"post":{"tags":["diff"],"summary":"Structurally diff two documents. $0.002 per call.","description":"Returns an RFC 6902 JSON Patch that turns `a` into `b`, plus a human-readable summary and per-op counts. Arrays are diffed with an LCS, so a single insertion produces one `add` rather than replacing the tail. `POST /patch` with the returned patch reproduces `b` exactly.","x-price-usd":"$0.002","x-payment-protocol":"x402/v2","x-payment-network":"eip155:8453","x-payment-asset":"USDC","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["a","b"],"properties":{"from":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto","description":"Format of both documents."},"fromA":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto"},"fromB":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto"},"a":{"oneOf":[{"type":"string"},{"type":"object"},{"type":"array"}]},"b":{"oneOf":[{"type":"string"},{"type":"object"},{"type":"array"}]},"options":{"type":"object","additionalProperties":true}}},"examples":{"yaml":{"value":{"from":"yaml","a":"name: app\nreplicas: 2\n","b":"name: app\nreplicas: 3\nimage: nginx\n"}},"across formats":{"value":{"fromA":"json","fromB":"yaml","a":"{\"a\":1}","b":"a: 2\n"}}}}}},"responses":{"200":{"description":"Success. Settles $0.002 in USDC on Base.","content":{"application/json":{"schema":{"type":"object","required":["equal","patch","summary","counts"],"properties":{"equal":{"type":"boolean"},"fromA":{"type":"string"},"fromB":{"type":"string"},"counts":{"type":"object","properties":{"add":{"type":"integer"},"remove":{"type":"integer"},"replace":{"type":"integer"},"total":{"type":"integer"}}},"patch":{"type":"array","items":{"type":"object","required":["op","path"],"properties":{"op":{"type":"string","enum":["add","remove","replace"]},"path":{"type":"string"},"value":{}}}},"summary":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-fatal notes: detected format, coercion decisions, dropped nulls, and so on."}}}}}},"400":{"description":"Malformed request, unparseable input, or a spec/schema error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"402":{"description":"Payment required. The `PAYMENT-REQUIRED` response header carries the base64 x402 v2 challenge.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired object.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Input or output over the size cap. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"500":{"description":"Internal error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"502":{"description":"The payment facilitator was unreachable. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/patch":{"post":{"tags":["diff"],"summary":"Apply an RFC 6902 JSON Patch. $0.002 per call.","description":"Supports add, remove, replace, move, copy and test, applied in order with strict pointer resolution. A failure names the operation index and the reason. Output can be any supported format, defaulting to the input format.","x-price-usd":"$0.002","x-payment-protocol":"x402/v2","x-payment-network":"eip155:8453","x-payment-asset":"USDC","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["data","patch"],"properties":{"from":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties","auto"],"default":"auto"},"to":{"type":"string","enum":["json","jsonl","csv","tsv","yaml","toml","xml","ini","properties"],"description":"Defaults to the input format."},"data":{"oneOf":[{"type":"string"},{"type":"object"},{"type":"array"}]},"patch":{"type":"array","maxItems":20000,"items":{"type":"object","required":["op","path"],"properties":{"op":{"type":"string","enum":["add","remove","replace","move","copy","test"]},"path":{"type":"string"},"from":{"type":"string"},"value":{}}}},"options":{"type":"object","additionalProperties":true},"toOptions":{"type":"object","additionalProperties":true}}},"examples":{"yaml":{"value":{"from":"yaml","to":"yaml","data":"name: app\nreplicas: 2\n","patch":[{"op":"replace","path":"/replicas","value":3}]}}}}}},"responses":{"200":{"description":"Success. Settles $0.002 in USDC on Base.","content":{"application/json":{"schema":{"type":"object","required":["format","applied","data"],"properties":{"format":{"type":"string"},"from":{"type":"string"},"applied":{"type":"integer"},"data":{"type":"string"},"rows":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-fatal notes: detected format, coercion decisions, dropped nulls, and so on."}}}}}},"400":{"description":"Malformed request, unparseable input, or a spec/schema error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"402":{"description":"Payment required. The `PAYMENT-REQUIRED` response header carries the base64 x402 v2 challenge.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired object.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"Input or output over the size cap. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"500":{"description":"Internal error. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"502":{"description":"The payment facilitator was unreachable. Never charged.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"csv_parse_error"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"securitySchemes":{"x402":{"type":"http","scheme":"x402","description":"x402 v2. Send `PAYMENT-SIGNATURE` with a base64 PaymentPayload signed for the challenge in `PAYMENT-REQUIRED`. USDC on Base (eip155:8453)."}}}}