# Toll402 JSON Schema Validator

> Toll402 JSON Schema Validator is a paid API for AI agents from toll402.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Validates a JSON value against a JSON Schema subset (type, properties, required, enum, minimum/maximum, minLength/maxLength, items) and returns structured validation errors

## Facts

- Endpoint: POST https://toll402.dev/v1/t/json_schema_validate
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/toll402-json-schema-validator-33db63ad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_leUTvRTKQEx61IS0_JPMf

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability toll402-json-schema-validator-33db63ad -d '<json body>'
```

Example prompt: Check whether this JSON object {"age": -1, "name": ""} is valid against this schema: {"type": "object", "required": ["age", "name"], "properties": {"age": {"type": "integer", "minimum": 0}, "name": {"type": "string", "minLength": 1}}} and tell me exactly which fields fail and why.

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call JSON Schema validation step without standing up a full validation library or service. It is ideal for agents validating LLM-generated JSON outputs, checking API request payloads before dispatch, or enforcing data contracts on dynamic user inputs. The supported subset (type, properties, required, enum, minimum/maximum, minLength/maxLength, items) covers the vast majority of practical validation needs. If you need full JSON Schema draft support including $ref, allOf/anyOf/oneOf, or complex conditionals, you may need a more complete validator.

## Known failure modes

- Schema uses unsupported JSON Schema keywords beyond the supported subset (type, properties, required, enum, minimum, maximum, minLength, maxLength, items) — unsupported keywords may be silently ignored
- Malformed schema object causes a processing error and no validation result is returned
- Very deeply nested schemas or large payloads may exceed processing limits
- Payment of 0.001 USDC not provided or x402 handshake fails — endpoint returns 402 Payment Required
- Invalid request body structure (missing 'schema' or 'value' fields) returns a bad request error

## How this service works

Validate a JSON value against a JSON Schema subset (type, properties, required, enum, minimum/maximum, minLength/maxLength, items) and return errors

## Output

A structured response listing all validation errors found when checking the provided JSON value against the supplied schema. Each error identifies the offending field and the constraint violated (e.g. type mismatch, missing required property, value out of range, invalid enum value, string too short or too long, array item violation). If the value is fully valid, an empty error list or success indicator is returned.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "schema",
      "value"
     ],
     "properties": {
      "value": {},
      "schema": {
       "type": "object"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toll402-json-schema-validator-33db63ad/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toll402.dev](https://www.zero.xyz/host/toll402.dev/llms.txt)
