Skip to content
data · documents · data · json-schema · schema-validation · json-validator · structured-output · validation · draft-2020-12 · contract · quality · deterministic · schema

JSON Schema validation

Validate JSON data against a bounded JSON Schema Draft 2020-12 contract for nested objects, arrays, required properties, types, enums, formats, lengths, patterns, and numeric bounds; return deterministic instance and schema JSON Pointers, explicit error truncation, input hashes, and no remote reference resolution.

$0.01 USDCBase + Solanax402 v2POSTCustomer-evidenced
Pay $0.01 USDC and run in your browserView free result sample

Endpoint

https://apiacre.com/v1/data/schema-validate

Send the JSON body below. An unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header; an x402-compatible buyer signs the requirement and retries with PAYMENT-SIGNATURE.

Pay $0.01 USDC and run in your browser

Official Coinbase agent path

Coinbase Agentic Wallet can satisfy this x402 request in one command. Running it may pay automatically, so --max-amount is fixed to $0.01 USDC in atomic units. Copying the command does not install, authenticate, sign, or pay; review the request and use a separate low-value wallet before running it.

npx --yes awal@latest x402 pay https://apiacre.com/v1/data/schema-validate \
  -X POST \
  -d '{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1},"score":{"type":"integer","minimum":0}},"required":["name","score"],"additionalProperties":false},"instance":{"name":"Ada","score":"98"},"max_errors":25,"check_formats":true}' \
  --max-amount 10000 \
  --json

Coinbase pay-for-service documentation · Buyer setup and wallet safety

Alternative third-party AgentCash commands

Run check first without payment. Its fetch command may automatically pay up to the exact listed price.

npx --yes agentcash@latest check https://apiacre.com/v1/data/schema-validate
npx --yes agentcash@latest fetch https://apiacre.com/v1/data/schema-validate \
  --method POST \
  --header 'content-type: application/json' \
  --body '{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1},"score":{"type":"integer","minimum":0}},"required":["name","score"],"additionalProperties":false},"instance":{"name":"Ada","score":"98"},"max_errors":25,"check_formats":true}' \
  --payment-protocol x402 \
  --payment-network base \
  --max-amount 0.010

AgentCash CLI documentation

Input example

{
  "schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1
      },
      "score": {
        "type": "integer",
        "minimum": 0
      }
    },
    "required": [
      "name",
      "score"
    ],
    "additionalProperties": false
  },
  "instance": {
    "name": "Ada",
    "score": "98"
  },
  "max_errors": 25,
  "check_formats": true
}

Response shape

View free static sample JSON

{
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
  "service": "data.schema-validate",
  "version": "1",
  "data": {
    "valid": false,
    "schemaValid": true,
    "instanceValid": false,
    "errorCount": 1,
    "errorCountExact": true,
    "errorsReturned": 1,
    "errorsTruncated": false,
    "errors": [
      {
        "kind": "instance",
        "instancePath": "/score",
        "schemaPath": "/properties/score/type",
        "keyword": "type",
        "message": "'98' is not of type 'integer'"
      }
    ],
    "schema": {
      "dialect": "https://json-schema.org/draft/2020-12/schema",
      "declaredDialect": "https://json-schema.org/draft/2020-12/schema",
      "utf8Bytes": 224,
      "sha256": "9565a3dfc9aaadfaf2b3163f433b954d7d91246b6c225c11a8c16fe42ae841e4",
      "remoteReferencesAllowed": false
    },
    "instance": {
      "utf8Bytes": 27,
      "sha256": "43d117eb76b608a0d05820c70320889a6577ff85446e00412b6e6487c1559149"
    },
    "validation": {
      "engine": "python-jsonschema",
      "engineVersion": "4.26.0",
      "draft": "2020-12",
      "formatChecking": true,
      "maxErrors": 25,
      "networkRequestsMade": false
    }
  },
  "meta": {
    "duration_ms": 42,
    "cached": false,
    "sources": [],
    "warnings": [],
    "next_actions": [
      {
        "service": "data.schema",
        "title": "JSON Schema generator",
        "reason": "Infer the rejected instance's observed Draft 2020-12 shape for comparison with the intended schema.",
        "method": "POST",
        "path": "/v1/data/schema",
        "price": "$0.025",
        "input_template": {
          "content": "$json($request.instance)",
          "format": "json",
          "root_mode": "preserve"
        },
        "use_output": "Run when this result.data.instanceValid is false, then compare the follow-up result.data.schema with the caller's intended contract; inference does not repair the instance or replace that contract.",
        "handoff_path": "/catalog/data.schema",
        "checkout_path": "/try/data.schema",
        "sample_path": "/samples/data.schema",
        "maximum_atomic_usdc": "25000",
        "handoff_payment_required": false,
        "executes_automatically": false,
        "authorization_required": true
      }
    ]
  }
}

Complete recipes using this API

These buyer-controlled recipes connect this service to compatible API Acre results. Every step has its own exact price and requires separate authorization.

Continue this workflow

These optional follow-ups use this result in a larger workflow. Each call shows a fresh x402 challenge and requires separate buyer authorization.

Try the payment challenge

curl -i -X POST 'https://apiacre.com/v1/data/schema-validate' \
  -H 'content-type: application/json' \
  --data '{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1},"score":{"type":"integer","minimum":0}},"required":["name","score"],"additionalProperties":false},"instance":{"name":"Ada","score":"98"},"max_errors":25,"check_formats":true}'