# OpenVerbs Format: Infer JSON Schema

> OpenVerbs Format: Infer JSON Schema is a paid API for AI agents from format.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-15).

Infers a JSON Schema (draft-07) from a sample document provided in any of 14 supported structured formats

## Facts

- Endpoint: POST https://format.openverbs.com/v1/infer-schema
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openverbs-format-infer-json-schema-f0114462
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_c1FUXojzwnQobpY5oRCD_

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 openverbs-format-infer-json-schema-f0114462 -d '<json body>'
```

Example prompt: Look at this sample JSON document and infer a draft-07 JSON schema from it — mark all present keys as required and merge any heterogeneous array item types: {"name":"Alice","age":30,"tags":["admin","user"]}

## When to prefer this

Choose this endpoint when you need to automatically derive a JSON Schema (draft-07) from an existing sample document without writing the schema by hand. It is especially useful when the source document is in a non-JSON format (YAML, CSV, TOML, XML, etc.) since it handles cross-format inference natively. It pairs naturally with the sibling /v1/validate endpoint on the same service. Prefer this over manual schema authoring or LLM-generated schemas when you need a deterministic, structurally accurate schema that faithfully reflects your sample data.

## Known failure modes

- Invalid or malformed input document — returns error if the document cannot be parsed in the specified format
- Unsupported format specified — only the 14 enumerated formats are accepted
- Empty data field — minLength:1 enforced, empty strings will be rejected
- Extremely large documents exceeding 1,000,000 characters — rejected by maxLength constraint
- Format mismatch — specifying 'yaml' for a JSON document may still work but specifying 'csv' for nested JSON will fail
- Payment failure — x402 payment of $0.004 USDC must succeed before the request is processed

## How this service works

Infer a JSON Schema (draft-07) from a sample document in any supported format. Types are inferred, present keys are marked required, and heterogeneous array item schemas are merged. The result validates out of the box with /v1/validate.

## Output

A JSON Schema (draft-07) object derived from the provided sample document. All keys present in the sample are marked as required, types are inferred from actual values, and heterogeneous array item schemas are merged into a unified schema. The result is compatible with the /v1/validate endpoint on the same service.

## 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",
     "required": [
      "data"
     ],
     "properties": {
      "data": {
       "type": "string",
       "maxLength": 1000000,
       "minLength": 1,
       "description": "The sample document to infer a schema from, as a string in the `from` format."
      },
      "from": {
       "enum": [
        "json",
        "json5",
        "jsonc",
        "yaml",
        "xml",
        "csv",
        "tsv",
        "toml",
        "ndjson",
        "ini",
        "env",
        "properties",
        "plist",
        "querystring"
       ],
       "type": "string",
       "description": "Source format of `data`. Default json."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

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