# fittings JSON Schema Inference

> fittings JSON Schema Inference is a paid API for AI agents from fittings.sh, paid per call via x402, $0.004999/call, status unknown (last checked 2026-10-09).

Infers a JSON Schema 2020-12 document from a set of sample JSON records, detecting unified types, required keys, array item types, and string formats.

## Facts

- Endpoint: POST https://fittings.sh/v1/schema/infer?utm_source=zero.xyz
- Price: $0.004999/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-09
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fittings-json-schema-inference-12eaa704
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Zh56fWvA6SIyar-dQ1WNO

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 fittings-json-schema-inference-12eaa704 -d '<json body>'
```

Example prompt: Can you look at these JSON records I have and automatically figure out the schema — unified types, which fields are required, array item types, and any string formats like dates or UUIDs?

## When to prefer this

Use this endpoint when you need to automatically derive a formal JSON Schema 2020-12 document from sample data, especially when dealing with unknown or undocumented data structures. Prefer it over manual schema writing when you have real examples but no schema, or when you want to document an API's response shape programmatically. It handles up to 1000 records at once and resolves string formats automatically.

## Known failure modes

- Input array exceeds 1000 records, 50000 nodes, or 32 levels of nesting — returns validation error
- Empty records array — may return minimal or empty schema
- Highly inconsistent record structures may produce overly permissive schemas with many anyOf branches
- Malformed JSON in records — parse error returned
- Payment not included or insufficient — 402 Payment Required

## How this service works

Infers a JSON Schema 2020-12 document from sample records: unified types, required keys, array item types and string formats.

## Output

A JSON Schema 2020-12 document that captures unified field types across all sample records, marks fields as required when present in all records, describes array item types, and detects common string formats (e.g. date-time, UUID, email). The schema reflects the union of all observed structures.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "records": {
   "type": "array",
   "description": "Up to 1000 JSON values, 50000 nodes and 32 levels deep"
  }
 }
}
```

## More

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