# apiacre.com Data Contract — Normalize, Infer Schema & Validate

> apiacre.com Data Contract — Normalize, Infer Schema & Validate is a paid API for AI agents from apiacre.com, paid per call via x402, $0.035/call, status unknown (last checked 2026-09-14).

Normalizes CSV, TSV, JSON, JSON Lines, or YAML into canonical JSON, infers a JSON Schema Draft 2020-12 from it, and optionally validates a second JSON value against that schema — all in one call.

## Facts

- Endpoint: POST https://apiacre.com/v1/data/contract
- Price: $0.035/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/apiacre-com-data-contract-normalize-infer-schema-validate-d7cdb930
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JMvmLl_fGzheWc-6fNzDa

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-data-contract-normalize-infer-schema-validate-d7cdb930 -d '<json body>'
```

Example prompt: Take this CSV data and normalize it to clean JSON, infer a Draft 2020-12 JSON schema from it, and then check whether this candidate record — {"name":"Alice","age":"thirty"} — is valid against that schema.

## When to prefer this

Choose this endpoint when you need to normalize heterogeneous data formats (CSV, TSV, YAML, JSON Lines) into canonical JSON and simultaneously obtain a machine-readable schema contract in a single atomic call. It is especially valuable when you want to validate a future or incoming record against the schema derived from your sample data in one round-trip, eliminating the need for separate normalization, schema inference, and validation steps.

## Known failure modes

- Unparseable input format returns a 4xx error indicating the format could not be detected or parsed
- Candidate value validation may fail with detailed schema violation messages rather than a hard error
- Ambiguous or empty input may result in a minimal or overly permissive inferred schema
- Malformed JSON in the candidate validation value returns a parse error
- Payment failure via x402 results in request rejection before processing

## How this service works

Normalize caller-supplied CSV, TSV, JSON, JSON Lines, or YAML to deterministic JSON, infer a Draft 2020-12 schema from that normalized value, and validate one future JSON value in a single x402 call.

## Output

Returns normalized canonical JSON from the input data, a fully inferred JSON Schema Draft 2020-12 describing the structure of that data, and (if a candidate value was supplied) a structured validation result including any schema violation errors.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "contract": {
    "input": {
     "format": "json",
     "records": 1,
     "rootMode": "records",
     "utf8Bytes": 46,
     "characters": 46
    },
    "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
    }
   },
   "pipeline": {
    "steps": [
     "normalize-to-json",
     "infer-draft-2020-12",
     "validate-instance"
    ],
    "version": "apiacre-data-contract/1",
    "deterministic": true,
    "networkRequestsMade": 0,
    "singlePaymentAuthorization": true
   },
   "normalized": {
    "format": "json",
    "content": "[\n  {\n    \"name\": \"Ada\",\n    \"score\": 98\n  }\n]",
    "records": 1,
    "rootMode": "records",
    "sourceFormat": "json"
   },
   "validation": {
    "valid": true,
    "errorCount": 0,
    "schemaValid": true,
    "instanceValid": true,
    "errorCountExact": true
   }
  },
  "meta": {
   "cached": false,
   "sources": [],
   "warnings": [],
   "duration_ms": 42,
   "next_actions": []
  },
  "service": "data.contract",
  "version": "1",
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/apiacre-com-data-contract-normalize-infer-schema-validate-d7cdb930/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)
