# JSON Schema Inference & Validation API

> JSON Schema Inference & Validation API is a paid API for AI agents from api.iamjuliand.com, paid per call via x402, $0.006/call, status unknown (last checked 2026-09-14).

Infers a JSON Schema from a JSON payload and validates whether a given JSON document conforms to a schema, returning validation results, detected errors, and schema inconsistencies.

## Facts

- Endpoint: POST https://api.iamjuliand.com/v1/json/schema
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-schema-inference-validation-api-eb98f42b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Gem3EsT2g3ELZVVyKwKj4

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-inference-validation-api-eb98f42b -d '<json body>'
```

Example prompt: Can you infer a JSON Schema from this sample object: {"id": 42, "active": true, "name": "Alice"} — use infer mode and tell me if the schema is valid and deterministic?

## When to prefer this

Choose this endpoint when you need to automatically derive a JSON Schema from a sample document, validate a JSON payload against a schema with detailed error reporting, or detect structural inconsistencies in JSON data. It is especially useful during API development, data pipeline validation, or when reverse-engineering schemas from unknown JSON sources. Prefer this over generic JSON linters when you need a full schema object back alongside validation results.

## Known failure modes

- Malformed JSON input returns a validation error list with parsing failures
- Invalid or conflicting schema properties may produce non-deterministic results flagged in the inconsistencies array
- Missing required fields in the request body may return a 400-level error
- Ambiguous JSON structures (e.g. mixed-type arrays) may yield partial or non-deterministic schemas

## How this service works

A public journal about ideas, systems, experiments, projects, and learning.

## Output

Returns a JSON object containing: whether the input is valid (boolean), a list of validation errors, an inferred JSON Schema object (using draft 2020-12), a deterministic flag indicating whether the schema is fully determined, a list of schema inconsistencies, the inference mode used, and a product version string.

## 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",
     "allOf": [
      {
       "if": {
        "properties": {
         "mode": {
          "const": "infer"
         }
        }
       },
       "then": {
        "required": [
         "samples"
        ]
       }
      },
      {
       "if": {
        "properties": {
         "mode": {
          "const": "validate"
         }
        }
       },
       "then": {
        "required": [
         "value",
         "schema"
        ]
       }
      }
     ],
     "required": [
      "mode"
     ],
     "properties": {
      "mode": {
       "enum": [
        "infer",
        "validate"
       ],
       "type": "string"
      },
      "value": {},
      "schema": {
       "type": "object"
      },
      "samples": {
       "type": "array",
       "maxItems": 100,
       "minItems": 1
      }
     },
     "additionalProperties": false
    },
    "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",
     "required": [
      "productVersion",
      "deterministic",
      "mode",
      "valid",
      "schema",
      "inconsistencies",
      "errors"
     ],
     "properties": {
      "mode": {
       "enum": [
        "infer",
        "validate"
       ],
       "type": "string"
      },
      "valid": {
       "type": "boolean"
      },
      "errors": {
       "type": "array"
      },
      "schema": {
       "type": "object"
      },
      "deterministic": {
       "const": true
      },
      "productVersion": {
       "type": "string"
      },
      "inconsistencies": {
       "type": "array"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "infer",
  "valid": true,
  "errors": [],
  "schema": {
   "type": "object",
   "$schema": "https://json-schema.org/draft/2020-12/schema",
   "required": [
    "active",
    "id"
   ],
   "properties": {
    "id": {
     "type": "integer"
    },
    "active": {
     "type": "boolean"
    }
   }
  },
  "deterministic": true,
  "productVersion": "1.0.0",
  "inconsistencies": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-schema-inference-validation-api-eb98f42b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.iamjuliand.com](https://www.zero.xyz/host/api.iamjuliand.com/llms.txt)
