{"openapi":"3.1.0","info":{"title":"Small-Payload Data Cleaner API","version":"0.1.0","description":"Pay-per-call API (x402, USDC) that cleans a small table (CSV text or JSON rows): tidy headers, real ISO dates, real numbers, empty values, booleans and duplicate rows, with every change that could lose information listed. Automated cleaning, check the issues list before relying on it.","x-guidance":"Use POST /v1/clean-data with JSON bodies. Unpaid calls receive HTTP 402 with x402 payment terms. See /llms.txt.","termsOfService":"https://ordstirr.com/agents/terms","contact":{"url":"https://ordstirr.com"}},"servers":[{"url":"https://clean.ordstirr.com"}],"paths":{"/health":{"get":{"operationId":"health","summary":"Free health check","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/clean-data":{"post":{"operationId":"cleanSmallTable","summary":"Clean a small CSV or JSON table: headers, ISO dates, numbers, empties, duplicate rows, with a list of every issue","description":"Send \"csv\" (text with a header row) or \"rows\" (array of objects), up to 200 rows and 30 columns. Returns cleaned rows, a type per column, and an issues list with the original text of anything it changed or could not read. Optional date_order (auto, mdy, dmy), dedupe, has_header, delimiter. Automated cleaning, check the issues before relying on it. Unpaid calls receive HTTP 402 with x402 payment terms. Invalid input is rejected with HTTP 400 and never charged.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"csv":{"type":"string","maxLength":14000,"description":"CSV text, first line is the header (unless has_header is false). Delimiter is detected (comma, semicolon, tab, pipe)."},"rows":{"type":"array","maxItems":200,"description":"Alternative to csv: array of flat objects with string, number, boolean or null values.","items":{"type":"object"}},"has_header":{"type":"boolean","description":"CSV only. Default true."},"delimiter":{"type":"string","maxLength":1,"description":"CSV only. One character; default is detected."},"date_order":{"type":"string","enum":["auto","mdy","dmy"],"description":"How to read dates like 03/04/2024. Default auto: decided from the column, month-first if there is no evidence."},"dedupe":{"type":"boolean","description":"Remove rows that repeat an earlier row. Default false (they are only reported)."}},"additionalProperties":false},"example":{"csv":"Order #, Order Date ,Total,Paid?\n1001,03/14/2024,\"$1,234.50\",Yes\n1002,3/15/24,$99.00,no\n1002,3/15/24,$99.00,no\n1003,N/A,(12.00),yes"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"},"example":{"headers":[{"original":"Order #","name":"order_number"},{"original":" Order Date ","name":"order_date"},{"original":"Total","name":"total"},{"original":"Paid?","name":"paid"}],"columns":[{"name":"order_number","type":"number","non_null":4,"nulls":0,"notes":[]},{"name":"order_date","type":"date","non_null":3,"nulls":1,"notes":["two_digit_years: 00-69 read as 2000s, 70-99 as 1900s","1 placeholder value(s) such as N/A or \"-\" became null"]},{"name":"total","type":"currency","unit":"USD","non_null":4,"nulls":0,"notes":[]},{"name":"paid","type":"boolean","non_null":4,"nulls":0,"notes":[]}],"rows":[{"order_number":1001,"order_date":"2024-03-14","total":1234.5,"paid":true},{"order_number":1002,"order_date":"2024-03-15","total":99,"paid":false},{"order_number":1002,"order_date":"2024-03-15","total":99,"paid":false},{"order_number":1003,"order_date":null,"total":-12,"paid":true}],"issues":[{"row":null,"column":null,"original":null,"code":"duplicate_rows","detail":"1 row(s) repeat an earlier row (data rows 3). They were kept; send dedupe true to remove them."}],"issues_total":1,"issues_truncated":false,"summary":{"rows_in":4,"rows_out":4,"columns":4,"duplicate_rows":1,"cells_changed":12,"nulls":1,"delimiter":","},"options_used":{"date_order":"auto","dedupe":false,"has_header":true},"terms_url":"https://ordstirr.com/agents/terms","notice":"Automated cleaning, informational only. Check the issues list before relying on it."}}}},"400":{"description":"Invalid input (never charged)"},"402":{"description":"Payment required (x402). See the PAYMENT-REQUIRED header."},"413":{"description":"Request body too large (never charged)"}}}}}}