# Agent402 JSON Schema Validator

> Agent402 JSON Schema Validator is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status down (last checked 2026-09-15).

Validates a JSON instance against a JSON Schema (type, required, properties, enum, min/max) and returns a deterministic pass/fail result with errors

## Facts

- Endpoint: POST https://agent402.co.uk/v1/validate/json-schema
- Price: $0.001/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-json-schema-validator-c9bd1502
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Tk5O-IMLDdv_CvwCym5g6

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 agent402-json-schema-validator-c9bd1502 -d '<json body>'
```

Example prompt: Before you send that tool call result downstream, validate it against this JSON Schema — schema requires 'name' (string), 'age' (integer, min 0), and 'status' (enum: active/inactive) — and tell me if the instance passes or what errors it found.

## When to prefer this

Choose this endpoint when you need fast, deterministic, server-side JSON Schema validation — particularly to catch LLM structured-output errors before they trigger irreversible side effects like payments or database writes. Prefer it over rolling your own validation logic when your agent is already calling micro-APIs and you want a cheap ($0.001), stateless, no-key-required validation step in a pipeline. Best for the core subset of JSON Schema (type, required, properties, enum, min/max). If you need full JSON Schema draft support including $ref or complex combiners, consider a dedicated validation library instead.

## Known failure modes

- Malformed JSON schema object causes 400-level error
- Instance or schema field missing from request body returns error
- Schema features outside the deterministic subset (e.g. $ref, allOf, oneOf) may not be supported
- Network or payment (x402) failure returns no validation result
- Very deeply nested schemas may exceed processing limits

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a JSON object with a boolean 'valid' field (true/false) and an 'errors' array listing any schema violations with details about which constraint failed (type mismatch, missing required field, enum violation, min/max breach, etc.). On success with no errors, 'errors' is an empty array.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "schema": {
   "type": "object",
   "description": "JSON Schema subset"
  },
  "instance": {
   "type": "object",
   "description": "Value to validate"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

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