# JSON Schema Validator

> JSON Schema Validator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Validates a JSON instance against a JSON Schema (draft 7 / 2020-12 subset) and returns a valid flag with per-field error codes and JSONPath locations.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/jsonschema-validate
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-schema-validator-60bcd035
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Mio-6H6Ubw1KbrVwX9-DZ

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 json-schema-validator-60bcd035 -d '<json body>'
```

Example prompt: Check whether this JSON object is valid against my JSON Schema and tell me exactly which fields fail and why, with their JSONPath locations: schema is {"type":"object","required":["name","age"],"properties":{"name":{"type":"string"},"age":{"type":"integer","minimum":0}}}, instance is {"name":"Alice","age":-5}.

## When to prefer this

Choose this endpoint when you need programmatic, structured validation of a JSON document against a formal JSON Schema with per-field JSONPath error reporting — especially useful in agent pipelines that need to gate on data quality before downstream processing, or when debugging exactly which fields violate which constraints. Prefer it over generic JSON linting tools when you need schema-driven type/format/required-field enforcement rather than syntax checking alone.

## Known failure modes

- Malformed JSON instance causes parse error before validation begins
- Invalid or unparseable JSON Schema document returns schema parse error
- Schema uses features outside draft 7 / 2020-12 subset, leading to partial or incorrect validation
- Very large or deeply nested documents may time out or return a payload-too-large error
- Missing required request fields (instance or schema) returns a 400 bad request

## How this service works

Validate a JSON instance against a JSON Schema (draft 7 / 2020-12 subset); returns a valid flag plus per-field errors with codes and JSONPath.

## Output

Returns a boolean 'valid' flag indicating overall pass/fail, plus an array of per-field error objects each containing an error code, a human-readable message, and a JSONPath expression pointing to the exact location of the violation within the JSON instance.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "schema": {
   "type": "object"
  },
  "instance": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "errors": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-schema-validator-60bcd035/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
