data · documents · data · data-contract · json-schema · schema-inference · schema-validation · structured-output · csv · tsv · json · jsonl · yaml · deterministic · offline

Structured data contract

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.

$0.035 USDCBasex402 v2POST
Pay $0.035 USDC and run in your browserView free result sample

Endpoint

https://apiacre.com/v1/data/contract

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.035 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.035 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/contract \
  -X POST \
  -d '{"content":"[{\"name\":\"Ada\",\"score\":98}]","format":"json","root_mode":"records","instance":[{"name":"Lin","score":91}],"max_errors":25,"check_formats":true}' \
  --max-amount 35000 \
  --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/contract
npx --yes agentcash@latest fetch https://apiacre.com/v1/data/contract \
  --method POST \
  --header 'content-type: application/json' \
  --body '{"content":"[{\"name\":\"Ada\",\"score\":98}]","format":"json","root_mode":"records","instance":[{"name":"Lin","score":91}],"max_errors":25,"check_formats":true}' \
  --payment-protocol x402 \
  --payment-network base \
  --max-amount 0.035

AgentCash CLI documentation

Input example

{
  "content": "[{\"name\":\"Ada\",\"score\":98}]",
  "format": "json",
  "root_mode": "records",
  "instance": [
    {
      "name": "Lin",
      "score": 91
    }
  ],
  "max_errors": 25,
  "check_formats": true
}

Response shape

View free static sample JSON

{
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
  "service": "data.contract",
  "version": "1",
  "data": {
    "normalized": {
      "sourceFormat": "json",
      "format": "json",
      "rootMode": "records",
      "content": "[\n  {\n    \"name\": \"Ada\",\n    \"score\": 98\n  }\n]",
      "records": 1,
      "inputSha256": "c643e5c255c8922bcd1163746ad6233618735d05482f8d2fa68e30021648f076",
      "outputSha256": "8ac612942f0f956fd991cf6c56221845102bb2aa773182f2a76044811c027982",
      "normalization": {
        "version": "apiacre-data-contract-normalization/1",
        "sourceRoot": "array",
        "nodesProcessed": 4,
        "nonStringKeysNormalized": 0,
        "dateTimeScalarsNormalized": 0,
        "outputEncoding": "json-indent-2-utf8",
        "deterministic": true,
        "networkRequestsMade": 0
      },
      "warnings": []
    },
    "contract": {
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "x-apiacre-observed": {
          "sampleCount": 1,
          "presentCount": 1,
          "missingCount": 0,
          "nullCount": 0,
          "types": [
            "array"
          ],
          "arrayLength": {
            "minimum": 1,
            "maximum": 1
          }
        },
        "items": {
          "type": "object",
          "x-apiacre-observed": {
            "sampleCount": 1,
            "presentCount": 1,
            "missingCount": 0,
            "nullCount": 0,
            "types": [
              "object"
            ]
          },
          "properties": {
            "name": {
              "type": "string",
              "x-apiacre-observed": {
                "sampleCount": 1,
                "presentCount": 1,
                "missingCount": 0,
                "nullCount": 0,
                "types": [
                  "string"
                ],
                "stringLength": {
                  "minimum": 3,
                  "maximum": 3
                }
              }
            },
            "score": {
              "type": "integer",
              "x-apiacre-observed": {
                "sampleCount": 1,
                "presentCount": 1,
                "missingCount": 0,
                "nullCount": 0,
                "types": [
                  "integer"
                ]
              }
            }
          },
          "required": [
            "name",
            "score"
          ]
        }
      },
      "input": {
        "format": "json",
        "rootMode": "records",
        "records": 1,
        "characters": 46,
        "utf8Bytes": 46,
        "sha256": "8ac612942f0f956fd991cf6c56221845102bb2aa773182f2a76044811c027982"
      },
      "inference": {
        "version": "apiacre-schema-inference/3",
        "dialect": "https://json-schema.org/draft/2020-12/schema",
        "csvNumericStringsCoerced": false,
        "csvEmptyStringsAsNull": false,
        "tabularNumericStringsCoerced": false,
        "tabularEmptyStringsAsNull": false,
        "nodesProcessed": 4,
        "nonStringKeysNormalized": 0,
        "dateTimeScalarsNormalized": 0,
        "observedBoundsEnforced": false,
        "maximumDepth": 20,
        "complete": true,
        "warnings": []
      }
    },
    "validation": {
      "valid": true,
      "schemaValid": true,
      "instanceValid": true,
      "errorCount": 0,
      "errorCountExact": true,
      "errorsReturned": 0,
      "errorsTruncated": false,
      "errors": [],
      "schema": {
        "dialect": "https://json-schema.org/draft/2020-12/schema",
        "declaredDialect": "https://json-schema.org/draft/2020-12/schema",
        "utf8Bytes": 699,
        "sha256": "2fbbfba7d86b6f96e4d91b6f1ae294331ef1efbad9aeae06bdd9da8a65470041",
        "remoteReferencesAllowed": false
      },
      "instance": {
        "utf8Bytes": 27,
        "sha256": "a690ea0e5beee5262d5ed4ffb7a1ea493ea6c8437d9171299be88c29b34259ce"
      },
      "validation": {
        "engine": "python-jsonschema",
        "engineVersion": "4.26.0",
        "draft": "2020-12",
        "formatChecking": true,
        "maxErrors": 25,
        "networkRequestsMade": false
      }
    },
    "pipeline": {
      "version": "apiacre-data-contract/1",
      "steps": [
        "normalize-to-json",
        "infer-draft-2020-12",
        "validate-instance"
      ],
      "singlePaymentAuthorization": true,
      "deterministic": true,
      "networkRequestsMade": 0
    }
  },
  "meta": {
    "duration_ms": 42,
    "cached": false,
    "sources": [],
    "warnings": [],
    "next_actions": []
  }
}

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.

Try the payment challenge

curl -i -X POST 'https://apiacre.com/v1/data/contract' \
  -H 'content-type: application/json' \
  --data '{"content":"[{\"name\":\"Ada\",\"score\":98}]","format":"json","root_mode":"records","instance":[{"name":"Lin","score":91}],"max_errors":25,"check_formats":true}'