{"slug":"keyronne-com-api-validate-json-6ae3ca","title":"Validate a JSON value against a JSON Schema and coerce common LLM-output mistake","host":"keyronne.com","method":"POST","resource":"https://keyronne.com/api/validate-json","category":"code","description":"Validate a JSON value against a JSON Schema and coerce common LLM-output mistakes (numbers as strings, stringified booleans, scalars where arrays are expected, missing defaults, extra properties). Returns the coerced value plus a structured error report. Built for cleaning up LLM tool-call arguments","price_listed":0.001,"price_asked":0.001,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":59,"reported_calls_30d":2,"reported_payers_30d":2,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"data":{"age":"36","name":"Ada"},"schema":{"properties":{"age":{"type":"integer"},"name":{"type":"string"}},"required":["name","age"],"type":"object"}},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"properties":{"body":{"properties":{"coerce":{"default":true,"description":"Attempt type coercion and default-filling before validating.","type":"boolean"},"data":{"description":"The candidate JSON value to validate and coerce."},"schema":{"description":"JSON Schema (draft-07 style subset: type, properties, required, items, enum, const, additionalProperties, min/max constraints, pattern, default).","type":"object"}},"required":["schema","data"],"type":"object"},"bodyType":{"enum":["json"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"type":"object"},"output":{"properties":{"errors":{"items":{"properties":{"message":{"type":"string"},"path":{"type":"string"}},"type":"object"},"type":"array"},"valid":{"type":"boolean"},"value":{"description":"The (possibly coerced) value."},"warnings":{"items":{"properties":{"message":{"type":"string"},"path":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":59,"error":null}],"description_full":"Validate a JSON value against a JSON Schema and coerce common LLM-output mistakes (numbers as strings, stringified booleans, scalars where arrays are expected, missing defaults, extra properties). Returns the coerced value plus a structured error report. Built for cleaning up LLM tool-call arguments and structured outputs. POST a JSON body like: {\"schema\":{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"name\":{\"type\":\"string\"},\"age\":{\"type\":\"integer\"}}},\"data\":{\"name\":\"Ada\",\"age\":\"36\"}}","last_updated":"2026-09-08T08:07:18.478Z","schemes":["exact"]}