$ man json-schema-validate
/json-schema-validate
PRICE / CALL
$0.003
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
wordmintCATEGORY
ai
STATUS
● live
NAME
json-schema-validate — validates any json document against any json schema, draft-07 or 2020-12
SYNOPSIS
POST https://x402.agentutility.ai/json-schema-validate
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
Validates any JSON document against any JSON Schema, draft-07 or 2020-12. Returns valid boolean, total error count, and per-error instance_path + schema_path + keyword + message. Powered by @cfworker/json-schema (MIT), a spec-walker validator with built-in format keyword support (email / uri / date / uuid / etc.). Check whether an LLM's structured output matches the spec you asked for, validate an API response against your documented schema, or add a verification gate to an agent pipeline. 200KB schema cap + 500KB data cap keep CPU bounded. Use it as a JSON Schema validator, JSON validator, structured-output verifier, or contract checker.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| schema | object | The JSON Schema document. Max 200,000 chars when stringified. | required |
| data | any | The JSON data to validate. Any value. Max 500,000 chars when stringified. | required |
| draft | string | Schema draft: '2020-12' (default) or 'draft-07'. | optional |
| valid_only | boolean | If true, skips per-error detail and returns only { valid, error_count }. Default false. | optional |
| formats | boolean | Deprecated no-op; format keywords (email, date, uri, uuid, etc.) are always validated. Accepted for backward compatibility. | optional |
OUTPUT — response shape
| field | type | description |
|---|---|---|
| valid | boolean | True when the data passed every constraint in the schema. |
| draft | string | Echo of which JSON Schema draft was used. |
| error_count | number | Total ajv errors raised before truncation. |
| truncated | boolean | True when error_count exceeded the 100-error cap and the errors array was trimmed. |
| errors | array | Per-error detail: instance_path (JSON pointer into the data), schema_path (JSON pointer into the schema), keyword (the constraint that failed), message (ajv's human-readable string), params (constraint-specific extras). Empty when valid_only is true. |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/json-schema-validate \
-H 'Content-Type: application/json' \
-d '{ }'first response =
402 Payment Required with payment requirements; sign + retry with X-PAYMENT.EXAMPLE 2 · mcp
# Install the MCP package for this endpoint's cluster npx -y @agentutility/mcp-<cluster> # Required: EVM private key with USDC on Base export X402_PRIVATE_KEY=0x... # Then call the json-schema-validate tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
- tags
- wordmintjson-schemavalidationschema-validateajvstructured-output
- methods
- POST
- cluster
- wordmint
- price
- $0.003 USDC per call
ADJACENT — other endpoints in wordmint
| endpoint | description | price |
|---|---|---|
| cron-next | Tells you exactly when a cron expression fires next. | $0.003 |
| cron-explain | Cron expression parser. | $0.002 |
| translate | AI translator. | $0.002 |
| brand-tagline | Generates brand taglines and slogans for launch pages, X bios, email copy, and product cards. | $0.005 |
| brand-tagline-generate | Generates tagline options for a brand or startup from its name, concept, audience, and tone. | $0.005 |
| card-resolve | Normalizes free-form graded card text into a canonical card object. | $0.005 |
| content-simhash | Fingerprints text with a 64-bit SimHash for near-duplicate detection, computed entirely locally. | $0.005 |
| cron-parse | Cron parser. | $0.005 |
SEE ALSO