# apiacre.com JSON Schema Inference

> apiacre.com JSON Schema Inference is a paid API for AI agents from apiacre.com, paid per call via x402, $0.025/call, status unknown (last checked 2026-09-13).

Infers a JSON Schema from a set of structured records by analyzing their fields, types, and patterns.

## Facts

- Endpoint: POST https://apiacre.com/v1/data/schema
- Price: $0.025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/apiacre-com-json-schema-inference-fc6eb80f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Zvo6dbkJMCS6SjDneAWOI

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 apiacre-com-json-schema-inference-fc6eb80f -d '<json body>'
```

Example prompt: Look at these JSON records I have and figure out the JSON Schema that describes them — infer the field names, types, and which fields are required.

## When to prefer this

Choose this endpoint when you need to automatically derive a JSON Schema from existing structured records without manually authoring one. Ideal for data pipeline bootstrapping, API contract generation, or documentation from sample data. Prefer this over manual schema authoring when records already exist and field types need to be discovered programmatically.

## Known failure modes

- Empty or null records array returns an error or minimal schema
- Inconsistent field types across records may produce union types or ambiguous results
- Deeply nested or highly irregular records may produce incomplete schemas
- Malformed JSON input returns a validation error
- Insufficient sample size may produce overly permissive schema

## How this service works

Create and generate a nested JSON Schema Draft 2020-12 contract by inferring field types and required fields from representative JSON, CSV, TSV, JSON Lines, or YAML records, with equivalent CSV/TSV numeric and null inference, input evidence, and non-enforcing observed bounds.

## Output

A JSON Schema object describing the structure of the input records, including field names, inferred data types, and likely required/optional designations derived from the provided sample data.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "format": {
   "enum": [
    "csv",
    "tsv",
    "json",
    "jsonl",
    "yaml"
   ],
   "type": "string"
  },
  "content": {
   "type": "string"
  },
  "root_mode": {
   "enum": [
    "records",
    "preserve"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "input": {
    "format": "json",
    "records": 1,
    "rootMode": "records",
    "utf8Bytes": 27,
    "characters": 27
   },
   "schema": {
    "type": "array",
    "items": {
     "type": "object",
     "required": [
      "name",
      "score"
     ],
     "properties": {
      "name": {
       "type": "string",
       "x-apiacre-observed": {
        "types": [
         "string"
        ],
        "nullCount": 0,
        "sampleCount": 1,
        "missingCount": 0,
        "presentCount": 1
       }
      },
      "score": {
       "type": "integer",
       "x-apiacre-observed": {
        "types": [
         "integer"
        ],
        "nullCount": 0,
        "sampleCount": 1,
        "missingCount": 0,
        "presentCount": 1
       }
      }
     },
     "x-apiacre-observed": {
      "types": [
       "object"
      ],
      "nullCount": 0,
      "sampleCount": 1,
      "missingCount": 0,
      "presentCount": 1
     }
    },
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "x-apiacre-observed": {
     "types": [
      "array"
     ],
     "nullCount": 0,
     "sampleCount": 1,
     "missingCount": 0,
     "presentCount": 1
    }
   },
   "inference": {
    "dialect": "https://json-schema.org/draft/2020-12/schema",
    "version": "apiacre-schema-inference/3",
    "csvEmptyStringsAsNull": false,
    "csvNumericStringsCoerced": false,
    "tabularNumericStringsCoerced": false
   }
  },
  "meta": {
   "cached": false,
   "sources": [],
   "warnings": [],
   "duration_ms": 42,
   "next_actions": [
    {
     "path": "/v1/data/schema-validate",
     "title": "JSON Schema validation",
     "method": "POST",
     "reason": "Validate a future JSON value against the inferred Draft 2020-12 contract.",
     "service": "data.schema-validate"
    }
   ]
  },
  "service": "data.schema",
  "version": "1",
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a"
 }
}
```

## More

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