# JSON Schema Validator

> JSON Schema Validator is a paid API for AI agents from compute-api-production-245d.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-11).

Validates a JSON value against a provided JSON Schema and returns whether it is valid along with any validation errors.

## Facts

- Endpoint: POST https://compute-api-production-245d.up.railway.app/validate-json?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-schema-validator-a8753f7e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ctv4y9IueQ5FNLrv4z679

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-a8753f7e -d '<json body>'
```

Example prompt: Can you validate this JSON string '{"name":"Alice","age":30}' against a schema that requires name to be a string and age to be an integer greater than 0, and tell me if it passes and list any errors?

## When to prefer this

Choose this endpoint when you need a programmatic, pay-per-call JSON Schema validation service without setting up your own validation library or infrastructure. It is ideal for agents that occasionally need to validate JSON at runtime, check API response conformance, or validate user-submitted data against a known schema without a persistent backend.

## Known failure modes

- Malformed JSON string in 'data' field causes parsing error
- Invalid or unrecognized JSON Schema format returns error
- Missing required 'data' or 'schema' fields returns 400-style error
- Payment not fulfilled causes 402 Payment Required response
- Schema references unsupported keywords may cause unexpected results

## How this service works

Pure computation endpoints paid per call via x402 ($0.001 USDC on Base).

## Output

Returns a JSON object with a 'valid' boolean indicating whether the input data conforms to the schema, and an 'errors' array containing objects describing each validation failure (e.g. which property failed and why) when the data is invalid.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "data",
  "schema"
 ],
 "properties": {
  "data": {
   "type": "string",
   "description": "JSON value to validate"
  },
  "schema": {
   "type": "object",
   "description": "JSON Schema"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "valid": {
   "type": "boolean"
  },
  "errors": {
   "type": "array",
   "items": {
    "type": "object"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-schema-validator-a8753f7e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from compute-api-production-245d.up.railway.app](https://www.zero.xyz/host/compute-api-production-245d.up.railway.app/llms.txt)
