Buyer-controlled x402 recipeRepair malformed JSON and enforce its contract
Apply only explicit deterministic syntax repairs to caller-supplied JSON, infer a Draft 2020-12 schema from the valid result, then validate a future JSON value.
3separately authorized steps
$0.04maximum listed total · USDC
eip155:8453 + solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdppayment networks
1$0.005 USDC · separate authorization
Deterministic JSON repair
Repair common syntax defects and retain transformation hashes.
POSThttps://apiacre.com/v1/data/json-repair
Input template
{
"content": "$malformedJson",
"repairs": [
"markdown_fence",
"comments",
"single_quoted_strings",
"unquoted_keys",
"python_literals",
"trailing_commas"
]
}
Use this resultContinue only if result.data.valid is true; inspect appliedRepairs and retain the input and output hashes.
2$0.025 USDC · separate authorization
JSON Schema generator
Infer a reusable contract from the repaired JSON value.
POSThttps://apiacre.com/v1/data/schema
Input template
{
"content": "$step1.result.data.content",
"format": "json",
"root_mode": "preserve"
}
Use this resultPass result.data.schema to the validation step.
3$0.01 USDC · separate authorization
JSON Schema validation
Validate a future caller-supplied value against the inferred contract.
POSThttps://apiacre.com/v1/data/schema-validate
Input template
{
"schema": "$step2.result.data.schema",
"instance": "$futureJsonValue",
"max_errors": 25,
"check_formats": true
}
Use this resultRequire result.data.valid and inspect bounded JSON Pointer errors before accepting the future value.
You stay in control. Each step is an independent API call. Inspect its HTTP 402 challenge, authorize no more than the displayed price, verify the result, and continue only when the output is suitable. The listed total is not a bundle charge.