# 24K Labs JSON Schema Validator

> 24K Labs 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 errors including codes and JSONPath locations.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/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/24k-labs-json-schema-validator-1994f243
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kEA-bACTqNKj40mZvrDAc

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 24k-labs-json-schema-validator-1994f243 -d '<json body>'
```

Example prompt: Check whether this JSON object is valid against my JSON Schema (draft 7): the instance is {"name":"Alice","age":"thirty"} and the schema requires name as a string and age as an integer — give me the valid flag and any per-field errors with their JSONPaths.

## When to prefer this

Choose this endpoint when you need per-field JSONPath-level error detail from a draft-7 or 2020-12 JSON Schema validation — especially useful in agent pipelines, CI/CD data contract checks, or form validation flows where you need structured, machine-readable error codes rather than a pass/fail only. Prefer over generic validators when you need the exact failing path and error code for downstream error handling or user feedback.

## Known failure modes

- Malformed JSON instance causes a parse error response
- Invalid or unrecognized JSON Schema syntax returns a schema-error response
- Use of JSON Schema features outside the draft 7 / 2020-12 subset may return unsupported-keyword errors
- Empty or missing request body returns a 400 bad request
- Extremely deeply nested schemas may time out or hit size limits

## 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 JSON object containing a boolean 'valid' flag indicating overall schema compliance, plus an array of per-field error objects each with an error code, a human-readable message, and a JSONPath string pointing to the exact failing location in the 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/24k-labs-json-schema-validator-1994f243/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)
