{"openapi":"3.1.0","info":{"title":"Agent Evidence Utility","version":"0.8.114","description":"Pay-per-call agent data-quality utilities: deterministic CSV cleanup, CSV import validation, validated CSV-to-JSON conversion, nested JSON contract checks, and schema drift monitoring, plus U.S. NWS forecasts and evidence-linked text/invoice extraction. CSV and JSON checks do not call a model. Preflight and audit responses omit cell values; validated imports return rows only when every record passes. Text routes include source quotes where applicable. Only /v1/pdf-text fetches validated public HTTPS PDF URLs; redirects and downloads are bounded, and neither URLs nor PDFs are retained. Cached free response examples are available at /examples/json-preflight, /examples/weather-batch, /examples/batch-text-insights, /examples/csv-monitor, /examples/csv-preflight, /examples/csv-import-audit, /examples/csv-import-json, /examples/csv-import-ready, /examples/csv-diff, /examples/csv-profile, /examples/extract-lite, /examples/extract-balanced, /examples/batch-extract-lite, and /examples/text-insights.","contact":{"url":"https://agent-evidence-extractor.defcronyke.workers.dev/llms.txt"},"x-guidance":"For CSV import and ETL workflows, use POST /v1/csv-clean for explicit deterministic per-column cleanup, or start with POST /v1/csv-import-ready to profile the data, validate caller-defined rules, and convert passing rows to JSON in one $0.005 call. Use POST /v1/csv-import-json for validation and conversion without profiling, or POST /v1/csv-preflight for row-numbered issue codes without cell values. Use POST /v1/csv-diff for a one-time comparison of two supplied snapshots; use POST /v1/csv-monitor for recurring feed updates and saved import rules. These routes are deterministic and make no model calls. Free request/response examples are linked in this specification.\nUse POST /v1/weather for one U.S. National Weather Service forecast and active alerts for $0.005, or POST /v1/weather-batch for 2 to 5 locations in one $0.01 batch. Both use supported latitude/longitude coordinates, are deterministic, and make no model calls. The default returns up to four 12-hour forecast periods; set forecast_type to hourly for up to 24 hourly periods. It also returns precipitation probability and relative humidity when available. Coverage varies; verify safety-critical conditions with weather.gov.\nUse POST /v1/json-preflight for deterministic JSON record contract checks at $0.005: nested object and array fields, required values, types, enum values, bounds, duplicate keys, and unexpected fields with issue paths only and no model call. Use POST /v1/csv-to-json to convert bounded CSV input into JSON objects keyed by headers at $0.005; values stay strings, blank rows are counted, malformed rows are rejected, and no model is called. Use POST /v1/json-to-csv to convert flat JSON records into comma-delimited CSV for $0.005, with escaped quotes and optional column order; formula-like cells remain unchanged. Use POST /v1/jsonl-convert to convert up to 1,000 JSON values to compact JSON Lines or parse JSON Lines to a JSON array for $0.005; nested values up to 64 levels are supported, but blank and malformed lines are rejected. Use POST /v1/csv-import-ready to optionally clean selected columns with explicit transformations, then profile CSV, validate caller-supplied types and rules, and convert passing rows to JSON in one $0.005 request; rejected rows return issue codes without cell values. Use POST /v1/csv-import-json for validation and conversion without profiling; optional explicit per-column transformations run before validation. Use POST /v1/csv-profile to infer conservative CSV column types, inspect blanks/distinct values and possible unique keys, and get a draft JSON Schema 2020-12 for $0.005. The schema is sample-based; review required fields and ambiguous types before production use. Use POST /v1/csv-import-audit for both profiling and validation against a supplied schema in one $0.005 request; optionally enable detect_duplicate_rows to flag repeated full rows by record number. Use POST /v1/csv-preflight to validate CSV imports with a supplied schema for $0.005; enable detect_duplicate_rows to catch exact repeated rows after outer whitespace trimming. Both are deterministic, return no cell values, and make no model calls. Use /v1/csv-diff to compare two snapshots for recurring schema drift at $0.005; it reports header/type/order changes, row-count deltas, and optional allowlist/required-header contract violations without cell values. Use /v1/csv-monitor with a private random token to compare successive feed uploads for $0.005 per update; only aggregate profiles are stored for up to 30 days, never raw CSV. Use /v1/text-insights for one-pass classification into caller-supplied categories, sentiment, keywords, a short summary and an exact supporting quote for $0.005. Use /v1/batch-text-insights to classify 2 to 5 short texts in parallel for $0.02 per batch, with one Luna pass and source quote checks per item. Use /v1/extract-lite for one-pass typed extraction at $0.005; it has no independent model cross-check. Use /v1/extract-balanced for two independent passes plus source-based reconciliation at $0.01; this is not an accuracy guarantee. Use /v1/invoice-extract for common invoice header fields from supplied OCR/text at $0.01 with printed date/amount strings and exact quotes, without line items or calculations. Use /v1/extract-fields, /v1/extract, or /v1/compare for evidence-linked extraction at $0.02; /v1/batch-extract remains $0.05 per batch. Inspect quotes before relying on model output."},"servers":[{"url":"https://agent-evidence-extractor.defcronyke.workers.dev"}],"x-discovery":{"payment":"x402","networks":["eip155:8453","eip155:42161","eip155:137"],"pricing":"Fixed USDC per successful call; see each operation."},"paths":{"/v1/weather":{"post":{"summary":"Get an NWS hourly or 12-hour forecast and active alerts ($0.005)","description":"Returns up to 24 hourly periods or eight 12-hour periods and, by default, active alerts for a supplied U.S. coordinate. Data is sourced from api.weather.gov, cached according to endpoint-specific refresh windows, and is not an official endorsement. NWS coverage is not available at every coordinate.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["latitude","longitude"],"additionalProperties":false,"properties":{"latitude":{"type":"number","minimum":17,"maximum":72},"longitude":{"type":"number","minimum":-180,"maximum":-60},"forecast_type":{"type":"string","enum":["12_hour","hourly"],"default":"12_hour"},"periods":{"type":"integer","minimum":1,"maximum":24,"description":"For 12_hour, 1–8 (default 4); for hourly, 1–24 (default 12)."},"include_alerts":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"NWS forecast periods and optional active alerts","content":{"application/json":{"schema":{"type":"object","required":["source","location","forecast_type","forecast_periods","active_alerts","note"],"properties":{"source":{"type":"string"},"location":{"anyOf":[{"type":"object","properties":{"city":{"type":"string"},"state":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"forecast_type":{"type":"string","enum":["12_hour","hourly"]},"forecast_periods":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"start_time":{"type":"string","format":"date-time"},"end_time":{"type":"string","format":"date-time"},"temperature":{"type":["number","null"]},"temperature_unit":{"type":"string"},"precipitation_probability_percent":{"type":["number","null"]},"relative_humidity_percent":{"type":["number","null"]},"wind_speed":{"type":"string"},"wind_direction":{"type":"string"},"short_forecast":{"type":"string"},"detailed_forecast":{"type":"string"}},"additionalProperties":false}},"active_alerts":{"type":"array","items":{"type":"object","properties":{"event":{"type":["string","null"]},"headline":{"type":["string","null"]},"severity":{"type":["string","null"]},"urgency":{"type":["string","null"]},"effective":{"type":["string","null"]},"expires":{"type":["string","null"]},"area_description":{"type":["string","null"]},"instruction":{"type":["string","null"]}},"additionalProperties":false}},"note":{"type":"string"}},"additionalProperties":false},"example":{"source":"U.S. National Weather Service API (api.weather.gov)","location":{"city":"Linn","state":"KS"},"forecast_type":"hourly","forecast_periods":[{"name":"This Afternoon","start_time":"2026-11-12T13:00:00-06:00","end_time":"2026-11-12T14:00:00-06:00","temperature":42,"temperature_unit":"F","precipitation_probability_percent":20,"relative_humidity_percent":65,"wind_speed":"10 mph","wind_direction":"NW","short_forecast":"Cloudy","detailed_forecast":"Cloudy."}],"active_alerts":[],"note":"Forecast periods and alerts are supplied by NWS and may change. Verify time-sensitive or safety-critical information at weather.gov. Coverage is limited to locations served by the U.S. NWS."}}}},"400":{"description":"Invalid coordinates or request"},"402":{"description":"x402 payment required"},"422":{"description":"No NWS coverage for these coordinates"},"502":{"description":"NWS unavailable"}}}},"/v1/weather-batch":{"post":{"summary":"Get U.S. forecasts for 2–5 locations in one call ($0.01)","description":"Fetches independent hourly or 12-hour forecasts and optional active alerts for 2 to 5 U.S. coordinates in one payment. All locations must have NWS coverage. No model calls.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locations"],"additionalProperties":false,"properties":{"locations":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","required":["latitude","longitude"],"properties":{"latitude":{"type":"number","minimum":17,"maximum":72},"longitude":{"type":"number","minimum":-180,"maximum":-60}},"additionalProperties":false}},"forecast_type":{"type":"string","enum":["12_hour","hourly"],"default":"12_hour"},"periods":{"type":"integer","minimum":1,"maximum":24,"description":"For 12_hour, 1–8 (default 4); for hourly, 1–24 (default 12)."},"include_alerts":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"An independent NWS forecast and alert report per location","content":{"application/json":{"schema":{"type":"object","required":["results","note"],"additionalProperties":false,"properties":{"results":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","required":["index","coordinates","source","location","forecast_type","forecast_periods","active_alerts","note"],"properties":{"index":{"type":"integer"},"coordinates":{"type":"object","required":["latitude","longitude"],"properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"additionalProperties":false},"source":{"type":"string"},"location":{"anyOf":[{"type":"object","properties":{"city":{"type":"string"},"state":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"forecast_type":{"type":"string","enum":["12_hour","hourly"]},"forecast_periods":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"start_time":{"type":"string","format":"date-time"},"end_time":{"type":"string","format":"date-time"},"temperature":{"type":["number","null"]},"temperature_unit":{"type":"string"},"precipitation_probability_percent":{"type":["number","null"]},"relative_humidity_percent":{"type":["number","null"]},"wind_speed":{"type":"string"},"wind_direction":{"type":"string"},"short_forecast":{"type":"string"},"detailed_forecast":{"type":"string"}},"additionalProperties":false}},"active_alerts":{"type":"array","items":{"type":"object","properties":{"event":{"type":["string","null"]},"headline":{"type":["string","null"]},"severity":{"type":["string","null"]},"urgency":{"type":["string","null"]},"effective":{"type":["string","null"]},"expires":{"type":["string","null"]},"area_description":{"type":["string","null"]},"instruction":{"type":["string","null"]}},"additionalProperties":false}},"note":{"type":"string"}},"additionalProperties":false}},"note":{"type":"string"}}}}}},"400":{"description":"Invalid weather batch"},"402":{"description":"x402 payment required"},"422":{"description":"No NWS coverage for one or more locations"},"502":{"description":"NWS unavailable for one or more locations"}}}},"/v1/batch-csv-preflight":{"post":{"summary":"Preflight 2–5 CSV files against one schema ($0.01 per batch)","description":"Checks each CSV independently against one shared schema, with optional exact duplicate-row detection after trimming outer whitespace. Two to five files, 262,144 combined characters, up to 1,000 records per file; deterministic, no model call, and no cell values returned.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items","columns"],"additionalProperties":false,"properties":{"items":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"string","minLength":1},"description":"Two to five CSV strings with at most 262,144 combined characters."},"columns":{"type":"object","minProperties":1,"maxProperties":50,"additionalProperties":{"type":"string","enum":["string","integer","number","boolean","date","email"]}},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"rules":{"type":"object","maxProperties":50},"unique_by":{"type":"array","maxItems":20,"items":{"type":"array","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string"}}},"flag_formula_cells":{"type":"boolean"},"detect_duplicate_rows":{"type":"boolean","description":"Optional exact full-row duplicate check; compares cell values after trimming outer whitespace and returns row numbers only."}}}}}},"responses":{"200":{"description":"One row/column-only preflight report per CSV plus aggregate counts","content":{"application/json":{"schema":{"type":"object","required":["results","summary","note"],"properties":{"results":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","required":["index","ok","summary","issues"]}},"summary":{"type":"object","required":["files","passed","failed","total_records"]},"note":{"type":"string"}}}}}},"400":{"description":"Invalid CSV batch or schema"},"402":{"description":"x402 payment required"}}}},"/v1/csv-profile":{"post":{"summary":"Infer a CSV schema and profile columns ($0.005)","description":"Deterministically infers conservative column types, missing-value counts, distinct-value counts, possible unique keys, and a draft JSON Schema from supplied CSV. It does not use a model or return cell values. The draft schema is based on sample values alone; review ambiguous fields and required properties before import.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"type":"string","minLength":1,"maxLength":262144}},"additionalProperties":false}}}},"responses":{"200":{"description":"CSV profile containing inferred column metadata and a draft JSON Schema, without cell values","content":{"application/json":{"schema":{"type":"object","required":["summary","columns","issues","suggested_json_schema","note"],"properties":{"summary":{"type":"object","required":["records","columns","blank_records","width_mismatch_records"],"properties":{"records":{"type":"integer"},"columns":{"type":"integer"},"blank_records":{"type":"integer"},"width_mismatch_records":{"type":"integer"}}},"columns":{"type":"array","items":{"type":"object","required":["name","inferred_type","non_empty_values","empty_values","distinct_values","unique_candidate","ambiguous"],"properties":{"name":{"type":"string"},"inferred_type":{"type":"string","enum":["string","integer","number","boolean","date","email"]},"non_empty_values":{"type":"integer"},"empty_values":{"type":"integer"},"distinct_values":{"type":"integer"},"unique_candidate":{"type":"boolean"},"ambiguous":{"type":"boolean"}}}},"issues":{"type":"array","items":{"type":"object","required":["record","code"],"properties":{"record":{"type":"integer"},"code":{"type":"string","enum":["blank_record","record_width_mismatch"]}}}},"suggested_json_schema":{"type":"object","description":"Draft JSON Schema 2020-12 inferred from sample values; review before production use.","required":["$schema","title","type","properties","required","additionalProperties"],"properties":{"$schema":{"type":"string"},"title":{"type":"string"},"type":{"const":"object"},"properties":{"type":"object","additionalProperties":true},"required":{"type":"array","items":{"type":"string"}},"additionalProperties":{"const":false}}},"note":{"type":"string"}}}}}},"400":{"description":"Invalid CSV or request"},"402":{"description":"x402 payment required"}}}},"/v1/csv-to-json":{"post":{"summary":"CSV to JSON with automatic delimiter detection ($0.005)","description":"Convert comma-, semicolon-, tab-, or pipe-delimited files into JSON objects with quote-aware delimiter detection for $0.005. The response reports the detected delimiter and preserves cell values as strings, including leading-zero identifiers. Blank rows are counted; duplicate headers and ragged rows are rejected. Deterministic, no model call, no source data retained.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"type":"string","minLength":1,"maxLength":262144,"description":"CSV with a header row, up to 100 columns and 1,000 records."}},"additionalProperties":false}}}},"responses":{"200":{"description":"CSV rows converted to JSON objects with detected delimiter and all values preserved as strings","content":{"application/json":{"schema":{"type":"object","required":["columns","row_count","skipped_blank_rows","delimiter","rows","note"],"properties":{"columns":{"type":"array","items":{"type":"string"}},"row_count":{"type":"integer"},"skipped_blank_rows":{"type":"integer"},"delimiter":{"type":"string","enum":["comma","semicolon","tab","pipe"]},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},"note":{"type":"string"}}}}}},"400":{"description":"Invalid or malformed CSV"},"402":{"description":"x402 payment required"}}}},"/v1/json-to-csv":{"post":{"summary":"JSON records to CSV ($0.005)","description":"Convert 1 to 1,000 flat JSON records to comma-delimited CSV. Preserves scalar values as text, escapes commas, quotes, and line breaks, and supports an explicit column order; deterministic, no model call. Formula-like values are preserved, not sanitized.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["records"],"additionalProperties":false,"properties":{"records":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","maxProperties":100,"additionalProperties":{"type":["string","number","boolean","null"]}}},"columns":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128},"description":"Optional explicit column order; all record keys must be declared."}}}}}},"responses":{"200":{"description":"Comma-delimited CSV and column metadata","content":{"application/json":{"schema":{"type":"object","required":["columns","row_count","csv","note"],"properties":{"columns":{"type":"array","items":{"type":"string"}},"row_count":{"type":"integer"},"csv":{"type":"string"},"note":{"type":"string"}}}}}},"400":{"description":"Invalid JSON records or columns"},"402":{"description":"x402 payment required"}}}},"/v1/jsonl-convert":{"post":{"summary":"Convert JSONL (NDJSON) to JSON and JSON to JSONL ($0.005)","description":"Convert up to 1,000 JSON values into compact JSON Lines or parse JSON Lines back into a JSON array. Nested values are supported to depth 64; a trailing newline is allowed, but blank or malformed lines are rejected. Deterministic, no model call, and no input retention.","tags":["data-conversion","jsonl","ndjson","json-lines","etl"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["direction"],"additionalProperties":false,"description":"Set direction to json_to_jsonl and provide records, or set it to jsonl_to_json and provide jsonl. Provide only the matching input field.","properties":{"direction":{"type":"string","enum":["json_to_jsonl","jsonl_to_json"]},"records":{"type":"array","minItems":1,"maxItems":1000,"description":"Required for json_to_jsonl. JSON values are serialized one per line; nested values are supported to depth 64."},"jsonl":{"type":"string","minLength":1,"maxLength":262144,"description":"Required for jsonl_to_json. One JSON value per line; at most 1,000 lines. A final newline is allowed."}}}}}},"responses":{"200":{"description":"Converted JSON Lines or parsed JSON records","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["direction","record_count","jsonl","note"],"properties":{"direction":{"const":"json_to_jsonl"},"record_count":{"type":"integer"},"jsonl":{"type":"string"},"note":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["direction","record_count","records","note"],"properties":{"direction":{"const":"jsonl_to_json"},"record_count":{"type":"integer"},"records":{"type":"array"},"note":{"type":"string"}},"additionalProperties":false}]}}}},"400":{"description":"Invalid direction, JSON Lines, or records"},"402":{"description":"x402 payment required"}}}},"/v1/csv-import-json":{"post":{"summary":"Validate CSV schema and convert ETL rows to typed JSON ($0.005)","description":"Pre-import CSV cleanup, validation, and conversion for ETL/database loads. Optional ordered per-column trim, whitespace-collapse, case, and control-character rules run before required-header, type, unique-key, and value-rule checks. Passing rows are converted into JSON. Set coerce_types=true for native numbers and booleans. Failed validation returns issue codes without cell values. Deterministic; no model call or source retention.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv","columns"],"additionalProperties":false,"properties":{"csv":{"type":"string","minLength":1,"maxLength":262144,"description":"CSV document with a header row; up to 1,000 records."},"columns":{"type":"object","minProperties":1,"maxProperties":50,"additionalProperties":{"type":"string","enum":["string","integer","number","boolean","date","email"]},"description":"Map expected CSV header names to types."},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"},"description":"Columns that may not be empty; each name must also appear in columns."},"rules":{"type":"object","maxProperties":50,"description":"Optional per-column rules, limited to 16,384 serialized characters.","additionalProperties":{"type":"object","additionalProperties":false,"properties":{"unique":{"type":"boolean"},"allowed":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":256}},"min":{"type":"number"},"max":{"type":"number"}}}},"flag_formula_cells":{"type":"boolean","description":"Optionally flag cells beginning with spreadsheet formula markers; reports only row/column and does not return or change values."},"detect_duplicate_rows":{"type":"boolean","description":"Optionally flag exact repeated full rows after trimming outer whitespace; reports row numbers only."},"unique_by":{"type":"array","maxItems":20,"description":"Optional composite keys. Each key lists 2 to 10 declared columns; duplicate complete tuples are reported without returning their values.","items":{"type":"array","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string"}}},"coerce_types":{"type":"boolean","description":"When true, convert declared integer, number, and boolean columns to native JSON numbers and booleans. Blank cells and string/date/email values remain strings."},"transformations":{"type":"object","minProperties":1,"maxProperties":50,"description":"Optional ordered cleanup rules applied to selected data columns before validation and JSON conversion.","additionalProperties":{"type":"array","minItems":1,"maxItems":5,"uniqueItems":true,"items":{"type":"string","enum":["trim","collapse_whitespace","lowercase","uppercase","remove_control_characters"]}}}}}}}},"responses":{"200":{"description":"Validation metadata and converted rows if valid; rejected input contains no cell values","content":{"application/json":{"schema":{"type":"object","required":["ok","validation","delimiter","rows","value_types_coerced","note"],"properties":{"ok":{"type":"boolean"},"validation":{"type":"object"},"delimiter":{"type":"string","enum":["comma","semicolon","tab","pipe"]},"columns":{"type":"array","items":{"type":"string"}},"row_count":{"type":"integer"},"skipped_blank_rows":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean"]}}},"value_types_coerced":{"type":"boolean"},"coerced_types":{"type":"array","items":{"type":"string","enum":["integer","number","boolean"]}},"cleaning":{"type":"object","properties":{"transformations_applied":{"type":"array","items":{"type":"string"}},"changed_cells":{"type":"integer"},"changed_cells_by_column":{"type":"object","additionalProperties":{"type":"integer"}}}},"note":{"type":"string"}}}}}},"400":{"description":"Invalid CSV or request"},"402":{"description":"x402 payment required"}}}},"/v1/csv-import-ready":{"post":{"summary":"Clean, validate, and convert CSV for ETL ($0.005)","description":"Clean selected CSV columns with optional ordered trim, whitespace-collapse, lowercase, uppercase, or control-character-removal rules; profile the result; validate required headers, caller-declared types, unique keys and value rules; and convert passing records to JSON. Set coerce_types=true to emit native JSON numbers and booleans. Transformations run before validation. Failed imports return profile data and issue codes without cell values. Deterministic; no model call.","tags":["csv-cleanup","csv-normalization","csv-to-json","csv-json-conversion","required-columns","csv-required-columns","csv-schema-validation","data-ingestion","etl"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv","columns"],"additionalProperties":false,"properties":{"csv":{"type":"string","minLength":1,"maxLength":262144,"description":"CSV document with a header row; up to 1,000 records."},"columns":{"type":"object","minProperties":1,"maxProperties":50,"additionalProperties":{"type":"string","enum":["string","integer","number","boolean","date","email"]},"description":"Map expected CSV header names to types."},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"},"description":"Columns that may not be empty; each name must also appear in columns."},"rules":{"type":"object","maxProperties":50,"description":"Optional per-column rules, limited to 16,384 serialized characters.","additionalProperties":{"type":"object","additionalProperties":false,"properties":{"unique":{"type":"boolean"},"allowed":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":256}},"min":{"type":"number"},"max":{"type":"number"}}}},"flag_formula_cells":{"type":"boolean","description":"Optionally flag cells beginning with spreadsheet formula markers; reports only row/column and does not return or change values."},"detect_duplicate_rows":{"type":"boolean","description":"Optionally flag exact repeated full rows after trimming outer whitespace; reports row numbers only."},"unique_by":{"type":"array","maxItems":20,"description":"Optional composite keys. Each key lists 2 to 10 declared columns; duplicate complete tuples are reported without returning their values.","items":{"type":"array","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string"}}},"coerce_types":{"type":"boolean","description":"When true, convert declared integer, number, and boolean columns to native JSON numbers and booleans. Blank cells and string/date/email values remain strings."},"transformations":{"type":"object","minProperties":1,"maxProperties":50,"description":"Optional ordered cleanup rules applied to selected data columns before validation and JSON conversion.","additionalProperties":{"type":"array","minItems":1,"maxItems":5,"uniqueItems":true,"items":{"type":"string","enum":["trim","collapse_whitespace","lowercase","uppercase","remove_control_characters"]}}}}}}}},"responses":{"200":{"description":"Profile and validation report, plus converted rows only when all records pass","content":{"application/json":{"schema":{"type":"object","required":["ok","validation","delimiter","rows","value_types_coerced","profile","note"],"properties":{"ok":{"type":"boolean"},"validation":{"type":"object"},"delimiter":{"type":"string","enum":["comma","semicolon","tab","pipe"]},"columns":{"type":"array","items":{"type":"string"}},"row_count":{"type":"integer"},"skipped_blank_rows":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean"]}}},"value_types_coerced":{"type":"boolean"},"coerced_types":{"type":"array","items":{"type":"string","enum":["integer","number","boolean"]}},"cleaning":{"type":"object","properties":{"transformations_applied":{"type":"array","items":{"type":"string"}},"changed_cells":{"type":"integer"},"changed_cells_by_column":{"type":"object","additionalProperties":{"type":"integer"}}}},"profile":{"type":"object"},"note":{"type":"string"}}}}}},"400":{"description":"Invalid CSV or request"},"402":{"description":"x402 payment required"}}}},"/v1/csv-preflight":{"post":{"summary":"Validate CSV rows before database import ($0.005)","description":"Validate CSV rows against a caller-defined import contract before database import or ETL. Checks required headers and values, declared types, allowed values and numeric bounds; optional checks cover unique or composite keys, exact duplicate rows and formula-like cells. Returns row-numbered issue codes without cell values. Deterministic; no model call. Supports 1,000 records and up to 50 typed columns.","tags":["csv-preflight","csv-validation","import-validation","schema-validation","data-import","etl","data-quality"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv","columns"],"additionalProperties":false,"properties":{"csv":{"type":"string","minLength":1,"maxLength":262144},"columns":{"type":"object","minProperties":1,"maxProperties":50,"additionalProperties":{"type":"string","enum":["string","integer","number","boolean","date","email"]}},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"rules":{"type":"object","maxProperties":50,"description":"Optional per-column rules, limited to 16,384 serialized characters.","additionalProperties":{"type":"object","additionalProperties":false,"properties":{"unique":{"type":"boolean"},"allowed":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":256}},"min":{"type":"number"},"max":{"type":"number"}}}},"flag_formula_cells":{"type":"boolean","description":"Optional heuristic for cells beginning with =, +, -, @, tab, carriage return, line feed, or locale-specific full-width formula markers; emits row/column-only review warnings and does not sanitize the CSV."},"detect_duplicate_rows":{"type":"boolean","description":"Optional exact full-row duplicate check; compares cell values after trimming outer whitespace and reports row numbers only."},"unique_by":{"type":"array","maxItems":20,"description":"Composite keys of 2 to 10 declared columns each.","items":{"type":"array","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string"}}}}}}}},"responses":{"200":{"description":"CSV preflight result with issue totals and row-numbered issues","content":{"application/json":{"schema":{"type":"object","required":["ok","summary","issues"],"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"summary":{"type":"object","required":["records","columns","issue_count","issue_counts","issues_truncated"],"additionalProperties":false,"properties":{"records":{"type":"integer"},"columns":{"type":"integer"},"issue_count":{"type":"integer"},"issue_counts":{"type":"object","additionalProperties":{"type":"integer"}},"issues_truncated":{"type":"boolean"}}},"issues":{"type":"array","items":{"type":"object","required":["record","code"],"additionalProperties":false,"properties":{"record":{"type":"integer","description":"Logical CSV record number; 0 denotes a header-level issue."},"code":{"type":"string","enum":["declared_column_missing","blank_record","record_width_mismatch","required_value_empty","invalid_value_type","duplicate_value","duplicate_composite_key","duplicate_row","value_not_allowed","value_out_of_range","formula_like_value"]},"column":{"type":"string"}}}}}}}}},"400":{"description":"Invalid CSV or request"},"402":{"description":"x402 payment required"}}}},"/v1/csv-clean":{"post":{"summary":"Clean messy CSV rows with explicit transformations ($0.005)","description":"Apply caller-selected, ordered trim, whitespace-collapse, lowercase, uppercase, or control-character-removal operations to named CSV columns. Returns transformed CSV and changed-cell counts. Untargeted cells, headers, blank rows, and string types are preserved. Operations are deterministic; no model call or input retention.","tags":["csv-cleaning","csv-normalization","data-cleaning","etl"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv","transformations"],"additionalProperties":false,"properties":{"csv":{"type":"string","minLength":1,"maxLength":262144,"description":"CSV document with a header row; up to 1,000 records."},"transformations":{"type":"object","minProperties":1,"maxProperties":50,"description":"Map exact, case-sensitive CSV column names to an ordered list of explicit transformations.","additionalProperties":{"type":"array","minItems":1,"maxItems":5,"uniqueItems":true,"items":{"type":"string","enum":["trim","collapse_whitespace","lowercase","uppercase","remove_control_characters"]}}}}}}}},"responses":{"200":{"description":"Transformed CSV with a per-column change summary","content":{"application/json":{"schema":{"type":"object","required":["csv","columns","records_processed","blank_rows_preserved","delimiter","changed_cells","changed_cells_by_column","note"],"properties":{"csv":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"records_processed":{"type":"integer"},"blank_rows_preserved":{"type":"integer"},"delimiter":{"type":"string","enum":["comma","semicolon","tab","pipe"]},"changed_cells":{"type":"integer"},"changed_cells_by_column":{"type":"object","additionalProperties":{"type":"integer"}},"note":{"type":"string"}}}}}},"400":{"description":"Invalid transformations or malformed CSV"},"402":{"description":"x402 payment required"}}}},"/v1/csv-duplicate-key-check":{"post":{"summary":"Find duplicate keys in CSV using key_columns ($0.005)","description":"Checks one or more caller-selected CSV header columns for repeated values or tuples. Returns row numbers and issue codes only; deterministic and no model call.","tags":["csv-duplicate-key","composite-keys","csv-validation","etl","database-import"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","key_columns"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"maxLength":262144,"description":"CSV document with a header row; up to 1,000 records."},"key_columns":{"type":"array","minItems":1,"maxItems":10,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128},"description":"One or more CSV header names comprising the key tuple."}}}}}},"responses":{"200":{"description":"Duplicate-key report without cell values","content":{"application/json":{"schema":{"type":"object","required":["ok","summary","issues"],"properties":{"ok":{"type":"boolean"},"summary":{"type":"object"},"issues":{"type":"array"}}}}}},"400":{"description":"Invalid CSV or key_columns"},"402":{"description":"x402 payment required"}}}},"/v1/json-preflight":{"post":{"summary":"Preflight JSON records against a data contract ($0.005)","description":"Deterministic validation for up to 1,000 JSON objects and 50 declared fields. Supports nested objects and arrays, required values, JSON types, enum values, numeric/string/array bounds, uniqueness, and unexpected properties. Returns record/property paths only; does not use a model or echo record values.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$defs":{"jsonProperty":{"anyOf":[{"type":"string","enum":["string","integer","number","boolean","array","object","null"]},{"type":"object","required":["type"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["string","integer","number","boolean","array","object","null"]},"properties":{"type":"object","maxProperties":50,"additionalProperties":{"$ref":"#/$defs/jsonProperty"}},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"items":{"$ref":"#/$defs/jsonProperty"},"additionalProperties":{"type":"boolean"},"enum":{"type":"array","maxItems":100,"items":{"type":["string","number","boolean","null"]}},"minimum":{"type":"number"},"maximum":{"type":"number"},"minLength":{"type":"integer","minimum":0},"maxLength":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0},"maxItems":{"type":"integer","minimum":0}}}]}},"type":"object","required":["records","properties"],"additionalProperties":false,"properties":{"records":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object"},"description":"Caller-supplied JSON objects; serialized input is limited to 262,144 characters."},"properties":{"type":"object","minProperties":1,"maxProperties":50,"additionalProperties":{"$ref":"#/$defs/jsonProperty"},"description":"Map field names to simple type strings or nested object/array schemas. Nested schema depth is limited to 8."},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"rules":{"type":"object","maxProperties":50,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"unique":{"type":"boolean"},"allowed":{"type":"array","maxItems":100,"items":{"type":["string","number","boolean"]}},"min":{"type":"number"},"max":{"type":"number"}}}},"unique_by":{"type":"array","maxItems":20,"items":{"type":"array","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string"}}},"allow_additional_properties":{"type":"boolean","description":"Defaults to false for top-level undeclared fields; set true to allow them."}}}}}},"responses":{"200":{"description":"Privacy-preserving validation report","content":{"application/json":{"schema":{"type":"object","required":["ok","summary","issues","note"],"properties":{"ok":{"type":"boolean"},"summary":{"type":"object","required":["records","properties","issue_count","issue_counts","issues_truncated"]},"issues":{"type":"array","items":{"type":"object","required":["record","code"],"properties":{"record":{"type":"integer"},"code":{"type":"string"},"property":{"type":"string"}}}},"note":{"type":"string"}}}}}},"400":{"description":"Invalid JSON records or contract"},"402":{"description":"x402 payment required"}}}},"/v1/csv-import-audit":{"post":{"summary":"Profile and validate a CSV import in one call ($0.005)","description":"Combines deterministic column profiling with validation against the supplied schema. Returns inferred type signals, aggregate counts, and row/column issue codes without echoing cell values; no model call. CSV input is limited to 262,144 characters and 1,000 records.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv","columns"],"additionalProperties":false,"properties":{"csv":{"type":"string","minLength":1,"maxLength":262144},"columns":{"type":"object","minProperties":1,"maxProperties":50,"additionalProperties":{"type":"string","enum":["string","integer","number","boolean","date","email"]}},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"rules":{"type":"object","maxProperties":50},"unique_by":{"type":"array","maxItems":20},"flag_formula_cells":{"type":"boolean"},"detect_duplicate_rows":{"type":"boolean","description":"Optional exact full-row duplicate check; compares cell values after trimming outer whitespace and reports row numbers only."}}}}}},"responses":{"200":{"description":"Combined aggregate CSV profile and schema validation result; cell values are not returned."},"400":{"description":"Invalid CSV or schema"},"402":{"description":"x402 payment required"}}}},"/v1/csv-diff":{"post":{"tags":["CSV snapshot comparison"],"summary":"One-time CSV snapshot diff for schema changes ($0.005)","description":"One-time, stateless comparison of two bounded CSV snapshots to detect added or removed headers, inferred type changes, column reordering, missing-rate shifts, optional numeric-bound excursions, required/allowed header contract violations, row-count deltas, and malformed rows. Does not retain either file. Deterministic; no model call; returns aggregate change metadata only.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["before_csv","after_csv"],"properties":{"before_csv":{"type":"string","minLength":1,"maxLength":262144},"after_csv":{"type":"string","minLength":1,"maxLength":262144},"numeric_bounds":{"type":"object","maxProperties":50,"description":"Optional numeric min/max thresholds; returns out-of-bounds counts, not values.","additionalProperties":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"min":{"type":"number"},"max":{"type":"number"}}}},"allowed_columns":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"required_columns":{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}}},"additionalProperties":false}}}},"responses":{"200":{"description":"CSV schema and row-count differences without cell values","content":{"application/json":{"schema":{"type":"object","required":["schema_changed","contract_violations","changes","row_count","structural_issues","note"],"additionalProperties":false,"properties":{"schema_changed":{"type":"boolean"},"contract_violations":{"type":"object","required":["unexpected_columns","missing_required_columns"],"properties":{"unexpected_columns":{"type":"array","items":{"type":"string"}},"missing_required_columns":{"type":"array","items":{"type":"string"}}}},"changes":{"type":"object","required":["added_columns","removed_columns","inferred_type_changes","reordered_columns","missing_rate_changes","numeric_excursions"],"properties":{"added_columns":{"type":"array","items":{"type":"string"}},"removed_columns":{"type":"array","items":{"type":"string"}},"inferred_type_changes":{"type":"array","items":{"type":"object","required":["column","before","after"],"properties":{"column":{"type":"string"},"before":{"type":"string"},"after":{"type":"string"}}}},"reordered_columns":{"type":"array","items":{"type":"object","required":["column","before_position","after_position"],"properties":{"column":{"type":"string"},"before_position":{"type":"integer"},"after_position":{"type":"integer"}}}},"missing_rate_changes":{"type":"array","items":{"type":"object","required":["column","before_missing_rate","after_missing_rate","delta"],"properties":{"column":{"type":"string"},"before_missing_rate":{"type":"number"},"after_missing_rate":{"type":"number"},"delta":{"type":"number"}}}},"numeric_excursions":{"type":"array","items":{"type":"object","required":["column","before_out_of_bounds","after_out_of_bounds","delta"],"properties":{"column":{"type":"string"},"before_out_of_bounds":{"type":"integer"},"after_out_of_bounds":{"type":"integer"},"delta":{"type":"integer"}}}}}},"row_count":{"type":"object","properties":{"before":{"type":"integer"},"after":{"type":"integer"},"delta":{"type":"integer"}}},"structural_issues":{"type":"object","properties":{"before_width_mismatch_records":{"type":"integer"},"after_width_mismatch_records":{"type":"integer"},"before_blank_records":{"type":"integer"},"after_blank_records":{"type":"integer"}}},"note":{"type":"string"}}}}}},"400":{"description":"Invalid CSV or request"},"402":{"description":"x402 payment required"}}}},"/v1/csv-monitor":{"post":{"tags":["Recurring CSV feed monitoring","Persistent import validation"],"summary":"Monitor recurring CSV feeds for schema drift and import-rule violations ($0.005 per update)","description":"Stateful recurring CSV feed monitor for schema drift and saved import-rule checks. Reuse one private token as your scheduler sends successive snapshots; compare the current file with the prior snapshot and optionally enforce a saved import-validation contract. Retains aggregate profile and contract metadata for up to 30 days, never raw rows or cell values. The caller pushes updates; this endpoint does not poll a URL or send webhooks. Send forget:true to delete the monitor after payment settlement.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["monitor_token"],"properties":{"monitor_token":{"type":"string","minLength":32,"maxLength":256},"csv":{"type":"string","minLength":1,"maxLength":262144,"description":"Required unless forget is true."},"forget":{"type":"boolean"},"validation":{"type":"object","description":"Optional persistent contract; set once or replace on a later snapshot.","properties":{"columns":{"type":"object","minProperties":1,"maxProperties":50,"additionalProperties":{"type":"string","enum":["string","integer","number","boolean","date","email"]}},"required":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"unique_by":{"type":"array","maxItems":20,"items":{"type":"array","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string"}}},"rules":{"type":"object","maxProperties":50},"flag_formula_cells":{"type":"boolean"},"detect_duplicate_rows":{"type":"boolean"}},"required":["columns"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Profile comparison and, when a contract is configured, row-numbered validation issue codes without cell values"},"400":{"description":"Invalid monitor request, CSV, or contract"},"402":{"description":"x402 payment required"}}}},"/v1/text-insights":{"post":{"summary":"Classify text and return sentiment, keywords, a summary, and a supporting quote ($0.005)","description":"One gpt-6-luna medium-effort pass. Categories are supplied by the caller. Keywords are kept only when they occur in the text; classification is null unless the exact supporting quote is found. Verify model-generated analysis before consequential use.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","categories"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"maxLength":12000},"categories":{"type":"array","minItems":2,"maxItems":12,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64},"description":"Caller-defined category labels; case-insensitive duplicates are rejected."}}}}}},"responses":{"200":{"description":"One-pass text insights","content":{"application/json":{"schema":{"type":"object","required":["classification","sentiment","keywords","summary","evidence_quote","model","reasoning_effort","verification_passes","note"],"additionalProperties":false,"properties":{"classification":{"type":["string","null"],"description":"One of the caller's labels, or null if the source quote did not match."},"sentiment":{"type":"string","enum":["positive","neutral","negative","mixed"]},"keywords":{"type":"array","items":{"type":"string"},"description":"At most eight terms, each checked against the source text."},"summary":{"type":"string","maxLength":500},"evidence_quote":{"type":["string","null"]},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"verification_passes":{"type":"integer","const":1},"note":{"type":"string"}}}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 payment required"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model failure; no payment is settled"}}}},"/v1/batch-text-insights":{"post":{"summary":"Classify 2–5 short support tickets or reviews in one request ($0.02 per batch)","description":"Applies one gpt-6-luna medium-effort pass to each short text using shared caller-defined categories. Keywords and classification evidence are checked against each source text. Batch price is fixed regardless of item count; no independent model cross-check.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items","categories"],"additionalProperties":false,"properties":{"items":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"maxLength":2000}}}},"categories":{"type":"array","minItems":2,"maxItems":12,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}}}}},"responses":{"200":{"description":"One classification result per input text, in input order","content":{"application/json":{"schema":{"type":"object","required":["results","model","reasoning_effort","verification_passes","note"],"additionalProperties":false,"properties":{"results":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","required":["classification","sentiment","keywords","summary","evidence_quote"],"properties":{"classification":{"type":["string","null"]},"sentiment":{"type":"string","enum":["positive","neutral","negative","mixed"]},"keywords":{"type":"array","items":{"type":"string"}},"summary":{"type":"string"},"evidence_quote":{"type":["string","null"]}}}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"verification_passes":{"type":"integer","const":1},"note":{"type":"string"}}}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 payment required"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model failure; no payment is settled"}}}},"/v1/extract-lite":{"post":{"summary":"Low-cost single-pass typed extraction ($0.005)","description":"One gpt-6-luna pass with source-checked evidence quotes and no independent model cross-check. Use for straightforward fields that are inexpensive to verify downstream.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","fields"],"properties":{"text":{"type":"string","minLength":1,"maxLength":12000},"fields":{"type":"object","minProperties":1,"maxProperties":10,"additionalProperties":{"type":"string","enum":["string","number","integer","boolean"]}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":1}},"required":["data","evidence","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/extract-balanced":{"post":{"summary":"Balanced evidence-linked extraction ($0.01)","description":"Three gpt-6-luna medium-effort passes: two independent extractions and one reconciliation against the source. Exact evidence quotes are checked in code. This is an intermediate review tier, not an accuracy guarantee.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","fields"],"properties":{"text":{"type":"string","minLength":1,"maxLength":12000},"fields":{"type":"object","minProperties":1,"maxProperties":10,"additionalProperties":{"type":"string","enum":["string","number","integer","boolean"]}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":3}},"required":["data","evidence","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/invoice-extract":{"post":{"summary":"Extract invoice header fields with evidence ($0.01)","description":"Extract common invoice header fields from caller-supplied OCR/text using three gpt-6-luna medium-effort passes. Preserves printed date and amount strings, returns exact quotes, and does not calculate totals or extract line items.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"maxLength":12000,"description":"Caller-supplied invoice text or OCR output; no URL or file is fetched."}}}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":3}},"required":["data","evidence","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/invoice-parse":{"post":{"summary":"Parse invoice or receipt headers and line items with evidence ($0.02)","description":"Extracts common header fields and up to 30 printed line items from caller-supplied OCR/text. Three gpt-6-luna medium-effort passes; exact evidence quotes are checked in code. Dates and money stay as printed strings; no arithmetic or line-item calculations.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"maxLength":12000,"description":"Caller-supplied invoice/receipt text or OCR output. No file or URL is fetched."}}}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"supplier_name":{"type":["string","null"],"description":"Supplier or vendor name exactly as printed."},"invoice_number":{"type":["string","null"],"description":"Invoice identifier; preserve formatting."},"invoice_date":{"type":["string","null"],"description":"Printed issue date; preserve its original format."},"due_date":{"type":["string","null"],"description":"Printed payment due date; preserve its original format."},"currency":{"type":["string","null"],"description":"Currency explicitly shown; null if not explicit."},"subtotal":{"type":["string","null"],"description":"Printed subtotal, preserving currency and formatting."},"tax_amount":{"type":["string","null"],"description":"Printed tax amount, preserving currency and formatting."},"total_amount":{"type":["string","null"],"description":"Printed final amount due, preserving formatting."},"purchase_order_number":{"type":["string","null"],"description":"Printed purchase-order reference."},"payment_terms":{"type":["string","null"],"description":"Printed payment terms; do not infer."},"line_items":{"type":["array","null"],"maxItems":30,"items":{"type":"object","properties":{"description":{"type":["string","null"],"description":"Printed product or service description."},"sku":{"type":["string","null"],"description":"Printed item, product, or SKU code."},"quantity":{"type":["string","null"],"description":"Printed quantity, preserving formatting and units."},"unit_price":{"type":["string","null"],"description":"Printed per-unit price, preserving currency and formatting."},"amount":{"type":["string","null"],"description":"Printed line amount, preserving currency and formatting."}},"required":["description","sku","quantity","unit_price","amount"],"additionalProperties":false}}},"required":["supplier_name","invoice_number","invoice_date","due_date","currency","subtotal","tax_amount","total_amount","purchase_order_number","payment_terms","line_items"],"additionalProperties":false},"evidence":{"type":"object","properties":{"supplier_name":{"type":["string","null"]},"invoice_number":{"type":["string","null"]},"invoice_date":{"type":["string","null"]},"due_date":{"type":["string","null"]},"currency":{"type":["string","null"]},"subtotal":{"type":["string","null"]},"tax_amount":{"type":["string","null"]},"total_amount":{"type":["string","null"]},"purchase_order_number":{"type":["string","null"]},"payment_terms":{"type":["string","null"]},"line_items":{"type":["array","null"],"maxItems":30,"items":{"type":"object","properties":{"description":{"type":["string","null"]},"sku":{"type":["string","null"]},"quantity":{"type":["string","null"]},"unit_price":{"type":["string","null"]},"amount":{"type":["string","null"]}},"required":["description","sku","quantity","unit_price","amount"],"additionalProperties":false}}},"required":["supplier_name","invoice_number","invoice_date","due_date","currency","subtotal","tax_amount","total_amount","purchase_order_number","payment_terms","line_items"],"additionalProperties":false},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":3}},"required":["data","evidence","model","reasoning_effort","verification_passes","note"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/invoice-pdf-parse":{"post":{"summary":"Invoice or receipt PDF OCR to structured JSON ($0.01)","description":"Extract vendor, invoice number and dates, currency, subtotal, tax, total, purchase order, payment terms, and up to ten line items from a text or scanned invoice/receipt PDF. Accepts standard Base64 PDFs up to 256 KiB and two pages. Two gpt-6-luna medium-effort calls transcribe then extract fields; evidence quotes are checked against generated OCR text, not directly against PDF bytes. Review against the original.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pdf_base64"],"additionalProperties":false,"properties":{"pdf_base64":{"type":"string","contentEncoding":"base64","contentMediaType":"application/pdf","minLength":1,"maxLength":349528,"description":"Standard padded Base64 of an unencrypted PDF, at most 256 KiB and two pages. No URL is fetched."}}}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"supplier_name":{"type":["string","null"],"description":"Supplier or vendor name exactly as printed."},"invoice_number":{"type":["string","null"],"description":"Invoice identifier; preserve formatting."},"invoice_date":{"type":["string","null"],"description":"Printed issue date; preserve its original format."},"due_date":{"type":["string","null"],"description":"Printed payment due date; preserve its original format."},"currency":{"type":["string","null"],"description":"Currency explicitly shown; null if not explicit."},"subtotal":{"type":["string","null"],"description":"Printed subtotal, preserving currency and formatting."},"tax_amount":{"type":["string","null"],"description":"Printed tax amount, preserving currency and formatting."},"total_amount":{"type":["string","null"],"description":"Printed final amount due, preserving formatting."},"purchase_order_number":{"type":["string","null"],"description":"Printed purchase-order reference."},"payment_terms":{"type":["string","null"],"description":"Printed payment terms; do not infer."},"line_items":{"type":["array","null"],"maxItems":10,"items":{"type":"object","properties":{"description":{"type":["string","null"],"description":"Printed product or service description."},"sku":{"type":["string","null"],"description":"Printed item, product, or SKU code."},"quantity":{"type":["string","null"],"description":"Printed quantity, preserving formatting and units."},"unit_price":{"type":["string","null"],"description":"Printed per-unit price, preserving currency and formatting."},"amount":{"type":["string","null"],"description":"Printed line amount, preserving currency and formatting."}},"required":["description","sku","quantity","unit_price","amount"],"additionalProperties":false}}},"required":["supplier_name","invoice_number","invoice_date","due_date","currency","subtotal","tax_amount","total_amount","purchase_order_number","payment_terms","line_items"],"additionalProperties":false},"evidence":{"type":"object","properties":{"supplier_name":{"type":["string","null"]},"invoice_number":{"type":["string","null"]},"invoice_date":{"type":["string","null"]},"due_date":{"type":["string","null"]},"currency":{"type":["string","null"]},"subtotal":{"type":["string","null"]},"tax_amount":{"type":["string","null"]},"total_amount":{"type":["string","null"]},"purchase_order_number":{"type":["string","null"]},"payment_terms":{"type":["string","null"]},"line_items":{"type":["array","null"],"maxItems":10,"items":{"type":"object","properties":{"description":{"type":["string","null"]},"sku":{"type":["string","null"]},"quantity":{"type":["string","null"]},"unit_price":{"type":["string","null"]},"amount":{"type":["string","null"]}},"required":["description","sku","quantity","unit_price","amount"],"additionalProperties":false}}},"required":["supplier_name","invoice_number","invoice_date","due_date","currency","subtotal","tax_amount","total_amount","purchase_order_number","payment_terms","line_items"],"additionalProperties":false},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":2},"source_pdf_pages":{"type":"integer","minimum":1,"maximum":2}},"required":["data","evidence","model","reasoning_effort","verification_passes","source_pdf_pages","note"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/pdf-text":{"get":{"summary":"Extract text from a PDF URL ($0.005)","description":"Extract searchable PDF text page by page from a public HTTPS URL. GET ?url=... or POST pdf_url JSON. Up to 10 MiB and 20 pages; no OCR/model calls. Scanned PDFs without a text layer are refused. Query strings are redacted in Worker logs.","tags":["pdf-text","pdf-text-extraction","pdf-to-text","extract-pdf-text","pdf","document-text-extraction","page-by-page","rag"],"parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","maxLength":2048}}],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"responses":{"200":{"description":"Page-labeled PDF text","content":{"application/json":{"schema":{"type":"object","required":["page_count","text","truncated","note"],"properties":{"page_count":{"type":"integer"},"text":{"type":"string"},"truncated":{"type":"boolean"},"note":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid or non-public HTTPS URL"},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"413":{"description":"PDF exceeds the 10 MiB download limit"},"415":{"description":"Source is not a PDF or supported binary response"},"422":{"description":"Encrypted, malformed, too many pages, or no searchable text"},"502":{"description":"Source retrieval failed"}}},"post":{"summary":"Extract text from a PDF URL ($0.005)","description":"PDF text extraction from a public HTTPS URL, page by page. Up to 10 MiB and 20 pages; no OCR/model calls. Redirects and download size are bounded, local/private URL forms are rejected, and source URLs/documents are not retained.","tags":["pdf-text","pdf-text-extraction","pdf-to-text","extract-pdf-text","pdf","document-text-extraction","page-by-page","rag"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pdf_url"],"additionalProperties":false,"properties":{"pdf_url":{"type":"string","maxLength":2048,"description":"Public HTTPS URL returning a PDF; no credentials or private-network URLs."}}}}}},"responses":{"200":{"description":"Page-labeled PDF text","content":{"application/json":{"schema":{"type":"object","required":["page_count","text","truncated","note"],"properties":{"page_count":{"type":"integer"},"text":{"type":"string"},"truncated":{"type":"boolean"},"note":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid or non-public HTTPS URL"},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"413":{"description":"PDF exceeds the 10 MiB download limit"},"415":{"description":"Source is not a PDF or supported binary response"},"422":{"description":"Encrypted, malformed, too many pages, or no searchable text"},"502":{"description":"Source retrieval failed"}}}},"/pdf/extract":{"get":{"summary":"Extract text from a PDF URL ($0.005)","description":"Extract searchable PDF text page by page from a public HTTPS URL. Pass the URL as the url query parameter. Up to 10 MiB and 20 pages; no OCR/model calls. Scanned PDFs without a text layer are refused.","tags":["pdf","pdf-extract","pdf-text","pdf-text-extraction","extract-pdf-text","document-text-extraction","page-by-page","rag"],"parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","maxLength":2048}}],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"responses":{"200":{"description":"Page-labeled PDF text","content":{"application/json":{"schema":{"type":"object","required":["page_count","text","truncated","note"],"properties":{"page_count":{"type":"integer"},"text":{"type":"string"},"truncated":{"type":"boolean"},"note":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid or non-public HTTPS URL"},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"413":{"description":"PDF exceeds the 10 MiB download limit"},"415":{"description":"Source is not a PDF or supported binary response"},"422":{"description":"Encrypted, malformed, too many pages, or no searchable text"},"502":{"description":"Source retrieval failed"}}}},"/v1/invoice-parse-lite":{"post":{"summary":"Extract invoice fields and line items from text ($0.005)","description":"Parse caller-supplied invoice or receipt text or OCR into header fields and up to 10 printed line items. Each returned value has an exact source quote. One gpt-6-luna medium-effort pass; no independent cross-check, calculations, or accuracy guarantee.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"additionalProperties":false,"properties":{"text":{"type":"string","minLength":1,"maxLength":12000,"description":"Caller-supplied invoice/receipt text or OCR output. No file or URL is fetched."}}}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"supplier_name":{"type":["string","null"],"description":"Supplier or vendor name exactly as printed."},"invoice_number":{"type":["string","null"],"description":"Invoice identifier; preserve formatting."},"invoice_date":{"type":["string","null"],"description":"Printed issue date; preserve its original format."},"due_date":{"type":["string","null"],"description":"Printed payment due date; preserve its original format."},"currency":{"type":["string","null"],"description":"Currency explicitly shown; null if not explicit."},"subtotal":{"type":["string","null"],"description":"Printed subtotal, preserving currency and formatting."},"tax_amount":{"type":["string","null"],"description":"Printed tax amount, preserving currency and formatting."},"total_amount":{"type":["string","null"],"description":"Printed final amount due, preserving formatting."},"purchase_order_number":{"type":["string","null"],"description":"Printed purchase-order reference."},"payment_terms":{"type":["string","null"],"description":"Printed payment terms; do not infer."},"line_items":{"type":["array","null"],"maxItems":10,"items":{"type":"object","properties":{"description":{"type":["string","null"],"description":"Printed product or service description."},"sku":{"type":["string","null"],"description":"Printed item, product, or SKU code."},"quantity":{"type":["string","null"],"description":"Printed quantity, preserving formatting and units."},"unit_price":{"type":["string","null"],"description":"Printed per-unit price, preserving currency and formatting."},"amount":{"type":["string","null"],"description":"Printed line amount, preserving currency and formatting."}},"required":["description","sku","quantity","unit_price","amount"],"additionalProperties":false}}},"required":["supplier_name","invoice_number","invoice_date","due_date","currency","subtotal","tax_amount","total_amount","purchase_order_number","payment_terms","line_items"],"additionalProperties":false},"evidence":{"type":"object","properties":{"supplier_name":{"type":["string","null"]},"invoice_number":{"type":["string","null"]},"invoice_date":{"type":["string","null"]},"due_date":{"type":["string","null"]},"currency":{"type":["string","null"]},"subtotal":{"type":["string","null"]},"tax_amount":{"type":["string","null"]},"total_amount":{"type":["string","null"]},"purchase_order_number":{"type":["string","null"]},"payment_terms":{"type":["string","null"]},"line_items":{"type":["array","null"],"maxItems":10,"items":{"type":"object","properties":{"description":{"type":["string","null"]},"sku":{"type":["string","null"]},"quantity":{"type":["string","null"]},"unit_price":{"type":["string","null"]},"amount":{"type":["string","null"]}},"required":["description","sku","quantity","unit_price","amount"],"additionalProperties":false}}},"required":["supplier_name","invoice_number","invoice_date","due_date","currency","subtotal","tax_amount","total_amount","purchase_order_number","payment_terms","line_items"],"additionalProperties":false},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":1}},"required":["data","evidence","model","reasoning_effort","verification_passes","note"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/ubl-invoice-extract":{"post":{"summary":"Extract structured fields from UBL or CII e-invoice XML ($0.005)","description":"Deterministic extraction from caller-supplied UBL Invoice 2.x or UN/CEFACT CII CrossIndustryInvoice XML, including Factur-X/ZUGFeRD XML. Returns selected parties, identifiers, dates, up to 100 line items, tax subtotals, totals, and limited arithmetic checks. Not an EN 16931 compliance validator. No model call, URL fetch, or source retention.","tags":["invoice","e-invoice","ubl","cii","factur-x","zugferd","xml","invoice-extraction","line-items","vat","accounts-payable","no-model"],"x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["xml"],"additionalProperties":false,"properties":{"xml":{"type":"string","minLength":1,"maxLength":262144,"description":"Caller-supplied UBL Invoice 2.x or UN/CEFACT CII CrossIndustryInvoice XML (including Factur-X/ZUGFeRD XML). See /examples/ubl-invoice-extract for CII input and output. DOCTYPE and entity declarations are rejected. PDF files and URLs are not supported."}}}}}},"responses":{"200":{"description":"Selected UBL or CII invoice fields and limited arithmetic checks","content":{"application/json":{"schema":{"type":"object","required":["format","ubl_version","invoice_number","issue_date","due_date","currency","supplier","customer","line_items","line_items_truncated","tax_breakdown","totals","arithmetic_checks","evidence_paths","note"],"properties":{"format":{"type":"string"},"ubl_version":{"type":["string","null"]},"invoice_number":{"type":["string","null"]},"issue_date":{"type":["string","null"]},"due_date":{"type":["string","null"]},"currency":{"type":["string","null"]},"supplier":{"type":"object","required":["name","vat_id","vat_scheme"],"properties":{"name":{"type":["string","null"]},"vat_id":{"type":["string","null"]},"vat_scheme":{"type":["string","null"]}},"additionalProperties":false},"customer":{"type":"object","required":["name","vat_id","vat_scheme"],"properties":{"name":{"type":["string","null"]},"vat_id":{"type":["string","null"]},"vat_scheme":{"type":["string","null"]}},"additionalProperties":false},"line_items":{"type":"array","items":{"type":"object","required":["id","description","quantity","unit_code","unit_price","line_extension_amount","currency","vat_percent"],"properties":{"id":{"type":["string","null"]},"description":{"type":["string","null"]},"quantity":{"type":["string","null"]},"unit_code":{"type":["string","null"]},"unit_price":{"type":["string","null"]},"line_extension_amount":{"type":["string","null"]},"currency":{"type":["string","null"]},"vat_percent":{"type":["string","null"]}},"additionalProperties":false}},"line_items_truncated":{"type":"boolean"},"tax_breakdown":{"type":"array","items":{"type":"object","additionalProperties":true}},"totals":{"type":"object","additionalProperties":true},"arithmetic_checks":{"type":"array","items":{"type":"object","required":["name","status","difference"],"properties":{"name":{"type":"string"},"status":{"type":"string","enum":["not_checked","matches_within_0.02","differs"]},"difference":{"type":["string","null"]}},"additionalProperties":false}},"evidence_paths":{"type":"object","additionalProperties":{"type":"string"}},"note":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid JSON, XML, namespace, or unsupported declaration"},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"}}}},"/v1/extract":{"post":{"summary":"Extract structured fields and exact source quotes ($0.02)","description":"Provide text and a simple JSON Schema. The service returns one value and evidence quote per field; fields without a matching quote are null.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","schema"],"properties":{"text":{"type":"string","minLength":1,"maxLength":12000},"schema":{"type":"object","description":"JSON Schema object with 1 to 10 simple properties. Each property type is string, number, integer, boolean, null, or an array of those type names; optional enum and description are supported."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":7}},"required":["data","evidence","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/extract-fields":{"post":{"summary":"Extract typed fields without writing JSON Schema ($0.02)","description":"Provide text and a name-to-type field map; returns structured data and exact source quotes.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","fields"],"properties":{"text":{"type":"string","minLength":1,"maxLength":12000},"fields":{"type":"object","minProperties":1,"maxProperties":10,"additionalProperties":{"type":"string","enum":["string","number","integer","boolean"]}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":7}},"required":["data","evidence","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/batch-extract":{"post":{"summary":"Extract fields from 2–5 texts under one schema ($0.05 per batch)","description":"Returns one evidence-linked result per input text in input order. Up to 30,000 combined characters.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items","schema"],"properties":{"items":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":12000}},"additionalProperties":false}},"schema":{"type":"object","description":"JSON Schema object with 1 to 10 simple properties. Each property type is string, number, integer, boolean, null, or an array of those type names; optional enum and description are supported."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}}},"required":["data","evidence"],"additionalProperties":false}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":7}},"required":["results","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/batch-extract-lite":{"post":{"summary":"Low-cost extraction from 2–5 texts ($0.02 per batch)","description":"Runs one gpt-6-luna medium-effort pass per text. Returns typed values and exact source quotes; no independent cross-check. Up to 30,000 combined input characters.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items","fields"],"properties":{"items":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":12000}},"additionalProperties":false}},"fields":{"type":"object","minProperties":1,"maxProperties":10,"additionalProperties":{"type":"string","enum":["string","number","integer","boolean"]}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}}},"required":["data","evidence"],"additionalProperties":false}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":1}},"required":["results","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}},"/v1/compare":{"post":{"summary":"Compare before/after text for changed structured fields ($0.02)","description":"Extracts the same schema from both versions and returns changed field names and evidence for each version.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"summary":"x402"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["before","after","schema"],"properties":{"before":{"type":"string","minLength":1,"maxLength":12000},"after":{"type":"string","minLength":1,"maxLength":12000},"schema":{"type":"object","description":"JSON Schema object with 1 to 10 simple properties. Each property type is string, number, integer, boolean, null, or an array of those type names; optional enum and description are supported."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful extraction with typed values and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"before":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}}},"required":["data","evidence"],"additionalProperties":false},"after":{"type":"object","properties":{"data":{"type":"object","description":"Requested fields mapped to extracted values; unsupported fields are null.","additionalProperties":{"type":["string","number","integer","boolean","null"]}},"evidence":{"type":"object","description":"Requested fields mapped to exact source quotes; fields without a matching quote are null.","additionalProperties":{"type":["string","null"]}}},"required":["data","evidence"],"additionalProperties":false},"changed_fields":{"type":"array","items":{"type":"string"}},"model":{"type":"string","const":"gpt-6-luna"},"reasoning_effort":{"type":"string","const":"medium"},"note":{"type":"string","description":"Model output may be wrong; verify before consequential use."},"verification_passes":{"type":"integer","const":7}},"required":["before","after","changed_fields","model","reasoning_effort","note","verification_passes"],"additionalProperties":false}}}},"402":{"description":"x402 payment required; challenge specifies USDC price, supported EVM network, and recipient"},"429":{"description":"Daily model budget reached; no payment is settled"},"502":{"description":"Model or response validation failed; no payment is settled"}}}}}}