{"openapi":"3.1.0","info":{"title":"NAIF Gravity — x402 Paid Developer Tools","version":"1.0.0","description":"Four deterministic developer tools: JSON Validity Check ($1), API Response Shape Check ($2), JSON Normalize Mini ($3), CSV Schema Audit Mini ($5). Base Mainnet USDC via x402 v2. Availability follows regional payment policy, and only paid settlement releases results.","contact":{"url":"https://naifgravity.com"},"x-guidance":"Use POST /api/x402/json-validity-check with application/json and a jsonText string containing at most 4096 UTF-8 bytes. Never include tokens, passwords, private keys or customer records. Read the HTTP 402 Payment-Required challenge before authorizing a purchase; this route charges 1 USDC on Base (eip155:8453). Use an x402 v2 capable client for signed payment authorization. A challenge or listing is not proof of payment: the paid result is released only after verification and settlement. VALID, REPAIRED_SAFE_PATTERN and INVALID are bounded diagnostic outcomes; inferred schemas describe the supplied sample only. Saudi visitors use the store Apple Pay path; wallet availability follows the live regional policy."},"servers":[{"url":"https://naifgravity.com"}],"x-service-info":{"name":"NAIF Gravity","description":"NAIF Gravity JSON Validity Check: validate JSON from AI agents, API responses or automation workflows. For samples up to 4096 UTF-8 bytes, get a validity diagnosis, safe trailing-comma repair when applicable, canonical JSON, a sample-inferred JSON Schema and a JavaScript round-trip test. Malformed samples return a diagnosis. $1 USDC per call on Base.","iconUrl":"https://naifgravity.com/naif-gravity-logo.png"},"paths":{"/api/x402/json-validity-check":{"post":{"operationId":"checkJsonValidity","summary":"Validate one bounded JSON sample","description":"Send jsonText containing at most 4096 UTF-8 bytes. x402 authorization and settlement are required before a paid result. Invalid JSON receives a diagnosis; safe repair is limited to supported trailing-comma patterns.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"1.00"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonText":{"type":"string","maxLength":4096,"description":"Sanitized sample, maximum 4096 UTF-8 bytes."}},"required":["jsonText"],"additionalProperties":false},"example":{"jsonText":"{\"ok\":true}"}}}},"responses":{"200":{"description":"Paid bounded JSON diagnosis","content":{"application/json":{"schema":{"type":"object","description":"One-sample JSON result. INVALID is a diagnosis, not a successful repair.","properties":{"productId":{"const":"json-validity-check"},"kind":{"const":"json_actionable_artifact"},"status":{"type":"string","enum":["VALID","REPAIRED_SAFE_PATTERN","INVALID"]},"repairApplied":{"type":"string","enum":["none","trailing_comma_removed"]},"correctedJson":{"type":["string","null"],"description":"Canonical JSON; null for invalid input."},"inferredSchema":{"type":["object","null"],"description":"Schema inferred from this sample, not the full external contract."},"schemaNote":{"type":"string"},"validExample":{},"parseError":{"type":"string"},"validationTest":{"type":["object","null"],"properties":{"kind":{"const":"deterministic_round_trip"},"runtime":{"const":"javascript"},"code":{"type":"string"},"expected":{"const":"PASS"},"roundTripEqual":{"type":"boolean"},"topLevelType":{"enum":["object","array","string","integer","number","boolean","null"]},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}}},"remainingScope":{"type":"array","items":{"type":"string"}},"rawInputStored":{"const":false},"heavyWork":{"const":false}},"required":["productId","kind","status","correctedJson","inferredSchema","validExample","validationTest","rawInputStored","heavyWork"],"additionalProperties":true},"example":{"productId":"json-validity-check","kind":"json_actionable_artifact","status":"VALID","repairApplied":"none","correctedJson":"{\"ok\":true}","inferredSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":true},"schemaNote":"Schema is inferred from the supplied sample; it is not a claim about the full external contract.","validExample":{"ok":true},"validationTest":{"kind":"deterministic_round_trip","runtime":"javascript","code":"const v=JSON.parse(\"{\\\"ok\\\":true}\"); if(JSON.stringify(v)!==\"{\\\"ok\\\":true}\") throw new Error(\"ROUND_TRIP_MISMATCH\"); console.log(\"PASS\");","expected":"PASS","roundTripEqual":true,"topLevelType":"object","sha256":"4062edaf750fb8074e7e83e0c9028c94e32468a8b6f1614774328ef045150f93"},"remainingScope":["Cross-file contract validation","External API/MCP compatibility","CI integration are outside this free bounded check"],"rawInputStored":false,"heavyWork":false}}}},"400":{"description":"Invalid request."},"402":{"description":"x402 payment required; amount 1000000 atomic USDC units on Base.","headers":{"Payment-Required":{"description":"Base64 encoded x402 v2 challenge.","schema":{"type":"string"}}}},"404":{"description":"Not available for this regional payment policy."},"413":{"description":"Sample exceeds bounded size."},"503":{"description":"Payment adapter unavailable."}}}},"/api/x402/api-response-shape-check":{"post":{"operationId":"inspectApiResponseShape","summary":"Analyze a bounded JSON API response sample","description":"Inspect one valid JSON response sample: field/type map, structure and consistency notes. No external endpoint is accessed.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"2.00"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"responseText":{"type":"string","maxLength":4096,"description":"Sanitized bounded input, maximum 4096 UTF-8 bytes"},"expectedKeys":{"type":"array","maxItems":16,"items":{"type":"string","maxLength":80}}},"required":["responseText"],"additionalProperties":false},"example":{"responseText":"{\"ok\":true,\"items\":[{\"id\":7}]}"}}}},"responses":{"200":{"description":"Bounded paid result, released after verification and settlement","content":{"application/json":{"schema":{"type":"object","required":["productId","status"],"properties":{"productId":{"const":"api-response-shape-check"},"status":{"type":"string"}},"additionalProperties":true}}}},"400":{"description":"Input invalid or unsupported before payment."},"402":{"description":"x402 v2 payment required: Base USDC; read Payment-Required header before signing.","headers":{"Payment-Required":{"description":"Base64-encoded x402 v2 challenge.","schema":{"type":"string"}}}},"404":{"description":"Not available under the current geographic payment policy."},"413":{"description":"Input exceeds 4096 UTF-8 bytes."}}}},"/api/x402/json-normalizer":{"post":{"operationId":"normalizeJsonMini","summary":"Normalize and checksum a small JSON sample","description":"Sort nested JSON object keys and return canonical JSON, round-trip QA and a SHA-256 receipt.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"3.00"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonText":{"type":"string","maxLength":4096,"description":"Sanitized bounded input, maximum 4096 UTF-8 bytes"}},"required":["jsonText"],"additionalProperties":false},"example":{"jsonText":"{\"z\":2,\"a\":1}"}}}},"responses":{"200":{"description":"Bounded paid result, released after verification and settlement","content":{"application/json":{"schema":{"type":"object","required":["productId","status"],"properties":{"productId":{"const":"json-normalizer"},"status":{"type":"string"}},"additionalProperties":true}}}},"400":{"description":"Input invalid or unsupported before payment."},"402":{"description":"x402 v2 payment required: Base USDC; read Payment-Required header before signing.","headers":{"Payment-Required":{"description":"Base64-encoded x402 v2 challenge.","schema":{"type":"string"}}}},"404":{"description":"Not available under the current geographic payment policy."},"413":{"description":"Input exceeds 4096 UTF-8 bytes."}}}},"/api/x402/csv-schema-audit":{"post":{"operationId":"auditCsvSchemaMini","summary":"Audit a small CSV schema sample","description":"Inspect CSV fields/rows and return a normalized sample, schema QA and SHA-256 receipt.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"5.00"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"csvText":{"type":"string","maxLength":4096,"description":"Sanitized bounded input, maximum 4096 UTF-8 bytes"}},"required":["csvText"],"additionalProperties":false},"example":{"csvText":"id,name\n1,Ada"}}}},"responses":{"200":{"description":"Bounded paid result, released after verification and settlement","content":{"application/json":{"schema":{"type":"object","required":["productId","status"],"properties":{"productId":{"const":"csv-schema-audit"},"status":{"type":"string"}},"additionalProperties":true}}}},"400":{"description":"Input invalid or unsupported before payment."},"402":{"description":"x402 v2 payment required: Base USDC; read Payment-Required header before signing.","headers":{"Payment-Required":{"description":"Base64-encoded x402 v2 challenge.","schema":{"type":"string"}}}},"404":{"description":"Not available under the current geographic payment policy."},"413":{"description":"Input exceeds 4096 UTF-8 bytes."}}}}}}