{
  "x402Version": 2,
  "id": 29453,
  "slug": "29453",
  "resource": "https://foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev/v1/json/repair",
  "description": "Repair bounded near-JSON into valid deterministic JSON and optionally validate a safe JSON Schema subset.",
  "type": "http",
  "serviceName": "Foundry PAR-007",
  "resourceType": "AI Inference",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x25e8245f07d5e4873987293dad666afbe56a9608",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5000",
      "amountUsd": 0.005,
      "maxTimeoutSeconds": 60
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "additionalProperties": false,
        "properties": {
          "endpoint": {
            "const": "json-contract-repair",
            "type": "string"
          },
          "protocol": {
            "const": "x402-v2",
            "type": "string"
          },
          "result": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "input_sha256": {
                    "pattern": "^[a-f0-9]{64}$",
                    "type": "string"
                  },
                  "normalized_json": {
                    "type": "string"
                  },
                  "output_sha256": {
                    "pattern": "^[a-f0-9]{64}$",
                    "type": "string"
                  },
                  "repaired": {
                    "type": "boolean"
                  },
                  "repairs": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "schema_errors": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "schema_valid": {
                    "type": "boolean"
                  },
                  "valid": {
                    "const": true,
                    "type": "boolean"
                  },
                  "value": {
                    "description": "Repaired JSON value; any valid JSON type is allowed"
                  }
                },
                "required": [
                  "repaired",
                  "repairs",
                  "input_sha256",
                  "valid",
                  "value",
                  "normalized_json",
                  "schema_valid",
                  "schema_errors",
                  "output_sha256"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "error": {
                    "enum": [
                      "UNREPAIRABLE_JSON",
                      "MAX_DEPTH_EXCEEDED"
                    ],
                    "type": "string"
                  },
                  "input_sha256": {
                    "pattern": "^[a-f0-9]{64}$",
                    "type": "string"
                  },
                  "repaired": {
                    "type": "boolean"
                  },
                  "repairs": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "valid": {
                    "const": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "repaired",
                  "repairs",
                  "input_sha256",
                  "valid",
                  "error"
                ],
                "type": "object"
              }
            ]
          },
          "service": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "protocol",
          "result",
          "service",
          "version"
        ],
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "text": "{status: 'ok', count: 2,}"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "endpoint": "json-contract-repair",
            "protocol": "x402-v2",
            "result": {
              "input_sha256": "8147e3f39e30dbd5b9b6c4d29a06d543dc7402eda2d1b3d8d00b508b36977546",
              "normalized_json": "{\"count\":2,\"status\":\"ok\"}",
              "output_sha256": "321dcf1c0f4785b1a8db97d962655d69b487533cc4a8ca81da64795c7ed16dfd",
              "repaired": true,
              "repairs": [
                "quote-object-keys",
                "convert-single-quoted-strings",
                "remove-trailing-commas"
              ],
              "schema_errors": [],
              "schema_valid": true,
              "valid": true,
              "value": {
                "count": 2,
                "status": "ok"
              }
            },
            "service": "Foundry PAR-007",
            "version": "illustrative"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "max_repairs": {
                    "default": 8,
                    "maximum": 12,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "schema": {
                    "description": "Optional bounded JSON Schema subset.",
                    "type": "object"
                  },
                  "text": {
                    "maxLength": 32768,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "additionalProperties": false,
                "properties": {
                  "endpoint": {
                    "const": "json-contract-repair",
                    "type": "string"
                  },
                  "protocol": {
                    "const": "x402-v2",
                    "type": "string"
                  },
                  "result": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "input_sha256": {
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "normalized_json": {
                            "type": "string"
                          },
                          "output_sha256": {
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "repaired": {
                            "type": "boolean"
                          },
                          "repairs": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "schema_errors": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "schema_valid": {
                            "type": "boolean"
                          },
                          "valid": {
                            "const": true,
                            "type": "boolean"
                          },
                          "value": {
                            "description": "Repaired JSON value; any valid JSON type is allowed"
                          }
                        },
                        "required": [
                          "repaired",
                          "repairs",
                          "input_sha256",
                          "valid",
                          "value",
                          "normalized_json",
                          "schema_valid",
                          "schema_errors",
                          "output_sha256"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "error": {
                            "enum": [
                              "UNREPAIRABLE_JSON",
                              "MAX_DEPTH_EXCEEDED"
                            ],
                            "type": "string"
                          },
                          "input_sha256": {
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "repaired": {
                            "type": "boolean"
                          },
                          "repairs": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "valid": {
                            "const": false,
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "repaired",
                          "repairs",
                          "input_sha256",
                          "valid",
                          "error"
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  "service": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  }
                },
                "required": [
                  "endpoint",
                  "protocol",
                  "result",
                  "service",
                  "version"
                ],
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "json",
    "repair",
    "validation",
    "deterministic",
    "bazaar"
  ],
  "sourceHost": "foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev",
  "lastUpdated": "2026-10-05T05:55:15.858Z",
  "quality": {
    "calls30d": 3,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-10-05T05:55:15.227Z"
  },
  "metadata": {
    "serviceName": "Foundry PAR-007",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "body": {
              "text": "{status: 'ok', count: 2,}"
            },
            "bodyType": "json",
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "endpoint": "json-contract-repair",
              "protocol": "x402-v2",
              "result": {
                "input_sha256": "8147e3f39e30dbd5b9b6c4d29a06d543dc7402eda2d1b3d8d00b508b36977546",
                "normalized_json": "{\"count\":2,\"status\":\"ok\"}",
                "output_sha256": "321dcf1c0f4785b1a8db97d962655d69b487533cc4a8ca81da64795c7ed16dfd",
                "repaired": true,
                "repairs": [
                  "quote-object-keys",
                  "convert-single-quoted-strings",
                  "remove-trailing-commas"
                ],
                "schema_errors": [],
                "schema_valid": true,
                "valid": true,
                "value": {
                  "count": 2,
                  "status": "ok"
                }
              },
              "service": "Foundry PAR-007",
              "version": "illustrative"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "max_repairs": {
                      "default": 8,
                      "maximum": 12,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "schema": {
                      "description": "Optional bounded JSON Schema subset.",
                      "type": "object"
                    },
                    "text": {
                      "maxLength": 32768,
                      "minLength": 1,
                      "type": "string"
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "type": "object"
                },
                "bodyType": {
                  "enum": [
                    "json",
                    "form-data",
                    "text"
                  ],
                  "type": "string"
                },
                "method": {
                  "enum": [
                    "POST"
                  ],
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method",
                "bodyType",
                "body"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "additionalProperties": false,
                  "properties": {
                    "endpoint": {
                      "const": "json-contract-repair",
                      "type": "string"
                    },
                    "protocol": {
                      "const": "x402-v2",
                      "type": "string"
                    },
                    "result": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "properties": {
                            "input_sha256": {
                              "pattern": "^[a-f0-9]{64}$",
                              "type": "string"
                            },
                            "normalized_json": {
                              "type": "string"
                            },
                            "output_sha256": {
                              "pattern": "^[a-f0-9]{64}$",
                              "type": "string"
                            },
                            "repaired": {
                              "type": "boolean"
                            },
                            "repairs": {
                              "items": {
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "schema_errors": {
                              "items": {
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "schema_valid": {
                              "type": "boolean"
                            },
                            "valid": {
                              "const": true,
                              "type": "boolean"
                            },
                            "value": {
                              "description": "Repaired JSON value; any valid JSON type is allowed"
                            }
                          },
                          "required": [
                            "repaired",
                            "repairs",
                            "input_sha256",
                            "valid",
                            "value",
                            "normalized_json",
                            "schema_valid",
                            "schema_errors",
                            "output_sha256"
                          ],
                          "type": "object"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "error": {
                              "enum": [
                                "UNREPAIRABLE_JSON",
                                "MAX_DEPTH_EXCEEDED"
                              ],
                              "type": "string"
                            },
                            "input_sha256": {
                              "pattern": "^[a-f0-9]{64}$",
                              "type": "string"
                            },
                            "repaired": {
                              "type": "boolean"
                            },
                            "repairs": {
                              "items": {
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "valid": {
                              "const": false,
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "repaired",
                            "repairs",
                            "input_sha256",
                            "valid",
                            "error"
                          ],
                          "type": "object"
                        }
                      ]
                    },
                    "service": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "endpoint",
                    "protocol",
                    "result",
                    "service",
                    "version"
                  ],
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev",
    "manifest_name": "foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "example": {
      "endpoint": "string",
      "protocol": "string",
      "result": null,
      "service": "string",
      "version": "string"
    },
    "type": "string"
  }
}