# JSON Schema Generator from Example JSON

> JSON Schema Generator from Example JSON is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-15).

Generates a JSON Schema (draft 2020-12) from an example JSON object, inferring types, properties, required fields, and formats like date, email, and URI.

## Facts

- Endpoint: POST https://api.vextorium.com/v1/json-schema-generate?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-schema-generator-from-example-json-6d067c3b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_g1Sf2sMLmnBivRRLFS9nL

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-generator-from-example-json-6d067c3b -d '<json body>'
```

Example prompt: Take this JSON example — {"id": 1, "email": "user@example.com", "tags": ["admin"], "created": "2024-01-01"} — and generate a JSON Schema draft 2020-12 from it, detecting the required fields, types, and formats like email and date.

## When to prefer this

Use this endpoint when you need to quickly generate a standards-compliant JSON Schema (draft 2020-12) from an existing example JSON payload — especially useful for API documentation, LLM tool/function definitions, or output validation pipelines where writing schemas by hand would be tedious. Prefer this over manual schema authoring or generic LLM prompting when you need format detection (email, date, URI) and a structured, machine-readable schema output.

## Known failure modes

- Invalid or malformed input JSON may result in an error or incomplete schema
- Non-standard or deeply nested structures may not have all formats correctly inferred
- Missing required 'example' field in the body will cause a validation error
- Very large or complex JSON objects may produce incomplete schemas

## How this service works

Generate a JSON Schema (draft 2020-12) from an example JSON: types, properties, arrays, required fields and formats (date, date-time, email, uri). For API docs, tool definitions and output validation.

## Output

Returns a JSON Schema (draft 2020-12) object with inferred types for all properties, a list of required fields, array item schemas, and format annotations (e.g. 'email', 'date', 'date-time', 'uri') where applicable. The schema is ready for use in API documentation, LLM tool definitions, or runtime output validation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "example": {
   "description": "Example JSON (object or text)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": {
   "type": "object",
   "$schema": "https://json-schema.org/draft/2020-12/schema",
   "required": [
    "id",
    "email"
   ],
   "properties": {
    "id": {
     "type": "integer"
    },
    "tags": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "email": {
     "type": "string",
     "format": "email"
    },
    "created": {
     "type": "string",
     "format": "date"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-schema-generator-from-example-json-6d067c3b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
