{"slug":"api-zfinia-com-x402-v1-log-schema-contract-audit-084a72","title":"Audit newline-delimited JSON logs against a contract, and across the whole set","host":"api.zfinia.com","method":"POST","resource":"https://api.zfinia.com/x402/v1/log-schema-contract-audit","category":"code","description":"Audit newline-delimited JSON logs against a contract, and across the whole set. The two findings that need every line at once: a field whose type varies between lines, so an index either rejects the minority or coerces them silently; and a message field with nearly as many distinct values as lines, ","price_listed":0.19,"price_asked":0.19,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":5932,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"contract":{"field_types":{"duration_ms":"number","status":"number"},"permitted_levels":["debug","info","warn","error"],"require_timestamp_offset":true,"required_fields":["timestamp","level","message","service"]},"logs":"{\"timestamp\":\"2026-10-02T12:00:00.000Z\",\"level\":\"info\",\"message\":\"request completed\",\"status\":200,\"duration_ms\":12}\n{\"timestamp\":\"2026-10-02T12:00:01.000Z\",\"level\":\"ERROR\",\"message\":\"request failed for order 8827341 after 3 retries\",\"status\":500,\"duration_ms\":\"940\"}\n{\"timestamp\":\"2026-10-02T12:00:02.000Z\",\"level\":\"info\",\"message\":\"request failed for order 8827342 after 1 retries\",\"status\":500,\"duration_ms\":880}\n{\"timestamp\":\"2026-10-02 12:00:03.000\",\"level\":\"warn\",\"message\":\"request failed for order 8827343 after 2 retries\",\"status\":503}\n{\"timestamp\":\"2026-10-02T12:00:04.000Z\",\"level\":\"info\",\"message\":\"request failed for order 8827344 after 1 retries\",\"status\":500,\"duration_ms\":790}\n{\"level\":\"info\",\"message\":\"request failed for order 8827345 after 4 retries\",\"status\":500,\"duration_ms\":1200}\n{\"timestamp\":\"2026-10-02T12:00:06.000Z\",\"level\":\"info\",\"message\":\"request failed for order 8827346 after 2 retries\",\"status\":500,\"duration_ms\":810}\n{\"timestamp\":\"2026-10-02T12:00:07.000Z\",\"level\":\"info\",\"message\":\"request failed for order 8827347 after 1 retries\",\"status\":500,\"duration_ms\":760}\n{\"timestamp\":\"2026-10-02T12:00:08.000Z\",\"level\":\"info\",\"message\":\"request failed for order 8827348 after 3 retries\",\"status\":500,\"duration_ms\":920}\n{\"timestamp\":\"2026-10-02T12:00:09.000Z\",\"level\":\"info\",\"message\":\"request failed for order 8827349 after 1 retries\",\"status\":500,\"duration_ms\":700}\n{not json at all"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":false,"properties":{"field_types":{"type":"object"},"level_field":{"maxLength":128,"type":"string"},"message_field":{"maxLength":128,"type":"string"},"permitted_levels":{"items":{"type":"string"},"maxItems":50,"minItems":1,"type":"array"},"require_timestamp_offset":{"type":"boolean"},"required_fields":{"items":{"maxLength":256,"type":"string"},"maxItems":500,"minItems":1,"type":"array"},"timestamp_field":{"maxLength":128,"type":"string"}},"type":"object"},"logs":{"maxLength":2097152,"type":"string"}},"required":["logs","contract"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-10-04","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.19,"price_match":true,"latency_ms":5932,"error":null}],"description_full":"Audit newline-delimited JSON logs against a contract, and across the whole set. The two findings that need every line at once: a field whose type varies between lines, so an index either rejects the minority or coerces them silently; and a message field with nearly as many distinct values as lines, which is interpolated rather than templated so nothing groups and cost scales with volume. Also reports absent required fields, a level differing only in case, and a timestamp with no offset.","last_updated":"2026-10-04T08:33:15.895Z","schemes":["exact"]}