78trust / 100

Validate Json

by JSON Schema Validator in AI models & inference

x402 APIPassing, checked 8 min ago

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"}}

POST https://keyronne.com/api/validate-json

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
156 ms typical, 258 ms slowest 5%
Last check
8 min ago
Next check
in 25 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://keyronne.com/api/validate-json" \
  -H "content-type: application/json" \
  -d '{"data":{"age":"36","name":"Ada"},"schema":{"properties":{"age":{"type":"integer"},"name":{"type":"string"}},"required":["name","age"],"type":"object"}}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fkeyronne.com%2Fapi%2Fvalidate-json
const res = await pay("https://keyronne.com/api/validate-json", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"data":{"age":"36","name":"Ada"},"schema":{"properties":{"age":{"type":"integer"},"name":{"type":"string"}},"required":["name","age"],"type":"object"}}),
});
console.log(await res.json());

Example input

{
  "data": {
    "age": "36",
    "name": "Ada"
  },
  "schema": {
    "properties": {
      "age": {
        "type": "integer"
      },
      "name": {
        "type": "string"
      }
    },
    "required": [
      "name",
      "age"
    ],
    "type": "object"
  }
}

Example output

{
  "errors": [],
  "valid": true,
  "value": {
    "age": 36,
    "name": "Ada"
  },
  "warnings": [
    {
      "message": "coerced string \"36\" to integer",
      "path": "$.age"
    }
  ]
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
8 min agoPassed40265 ms$0.001
4 h agoPassed402209 ms$0.001
7 h agoPassed402156 ms$0.001
11 h agoPassed402164 ms$0.001
15 h agoPassed402231 ms$0.001
18 h agoPassed40248 ms$0.001
22 h agoPassed402258 ms$0.001
25 h agoPassed402174 ms$0.001
29 h agoPassed402141 ms$0.001
33 h agoPassed402152 ms$0.001
36 h agoPassed40252 ms$0.001
41 h agoPassed402298 ms$0.001