# JSON Schema Infer

> JSON Schema Infer is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-10).

Infers a JSON Schema from a provided JSON data sample, returning a typed schema with required fields and property types.

## Facts

- Endpoint: GET https://x402.agentindex.world/json/schema-infer?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-schema-infer-d0edf550
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0jxCHM3jxlwabN1uzb7lL

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-infer-d0edf550
```

Example prompt: Can you infer a JSON Schema from this data: {"name": "Alice", "age": 30, "active": true}? I want to know the types and which fields are required.

## When to prefer this

Use this endpoint when you have a sample JSON object and need a machine-readable schema definition automatically — particularly useful for building validators, documenting APIs, or bootstrapping data contracts without manually writing schemas.

## Known failure modes

- Missing or empty 'data' parameter returns an error or empty schema
- Malformed/non-JSON input may produce an incorrect or partial schema
- Deeply nested or polymorphic data may result in simplified or overly generic schema
- Payment failure (x402) if USDC balance on Base is insufficient

## How this service works

Infer a basic JSON Schema (types, object properties, array item type) from an example document.

## Output

Returns a JSON Schema object describing the inferred structure of the provided data, including property types (string, integer, boolean, etc.) and a list of required fields.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "title": "Data"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": {
   "type": "object",
   "required": [
    "name",
    "age",
    "active"
   ],
   "properties": {
    "age": {
     "type": "integer"
    },
    "name": {
     "type": "string"
    },
    "active": {
     "type": "boolean"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-schema-infer-d0edf550/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
