# BRAINIAC Contract Compare

> BRAINIAC Contract Compare is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.05/call, status unknown (last checked 2026-11-12).

Compares two JSON schemas or payloads to detect breaking and non-breaking changes, type mismatches, and required-field shifts

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/integration/contract-compare?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-contract-compare-509bd55a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CS1KruKRBZRPJr8DTlj9o

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 brainiac-contract-compare-509bd55a -d '<json body>'
```

Example prompt: Compare these two JSON schemas and tell me which changes are breaking — the old schema has 'total' as a number, the new one makes it a required integer. Treat it as the response side.

## When to prefer this

Choose this endpoint when you need a structured, machine-readable diff of two JSON schemas with explicit breaking-change classification — especially in CI/CD pipelines, pre-deployment checks, or agent workflows that need to gate on API compatibility. It is preferable to manual diffing or generic JSON diff tools because it understands JSON Schema semantics and labels effects. It operates fully offline (no external calls, no code execution), making it safe and deterministic.

## Known failure modes

- Malformed or invalid JSON in schema input returns a parse error
- Schemas exceeding the 200,000 character limit are rejected
- Unsupported JSON Schema keywords (beyond type, properties, required, additionalProperties, items, enum, const, length, range, email/date/date-time formats) are reported but not applied
- Field mapping suggestions are only generated when path or field name matches — ambiguous renames may not be detected
- Breaking/non-breaking labels are only returned when 'side' is explicitly set to 'request' or 'response'
- File uploads exceeding 12MB base64 are rejected

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

Returns a structured JSON object with a 'changes' array where each entry includes a code (e.g. 'required_added', 'type_changed'), the field path, before/after values, a human-readable detail, and an 'effect' label ('breaking' or 'non-breaking'). Also includes metadata flags: codeExecuted, externalCall, valuesInvented, schemaCompliance, and a limitations list explaining what the engine covers.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "file": {
   "type": "object",
   "required": [
    "mediaType",
    "fileBase64"
   ],
   "properties": {
    "filename": {
     "type": "string",
     "maxLength": 180,
     "minLength": 1
    },
    "mediaType": {
     "enum": [
      "application/json",
      "text/plain"
     ],
     "type": "string"
    },
    "fileBase64": {
     "type": "string",
     "maxLength": 12000000,
     "minLength": 1
    }
   },
   "additionalProperties": false
  },
  "json": {
   "type": "string",
   "maxLength": 200000
  },
  "side": {
   "enum": [
    "request",
    "response"
   ],
   "type": "string"
  },
  "after": {},
  "before": {},
  "schema": {},
  "source": {},
  "target": {},
  "example": {},
  "payload": {},
  "examples": {
   "type": "array",
   "items": {},
   "maxItems": 20
  },
  "toVersion": {
   "type": "string",
   "maxLength": 40,
   "minLength": 1
  },
  "operations": {
   "type": "array",
   "items": {
    "oneOf": [
     {
      "type": "object",
      "required": [
       "op",
       "from",
       "to"
      ],
      "properties": {
       "op": {
        "type": "string",
        "const": "rename"
       },
       "to": {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       },
       "from": {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       }
      },
      "additionalProperties": false
     },
     {
      "type": "object",
      "required": [
       "op",
       "from",
       "to"
      ],
      "properties": {
       "op": {
        "type": "string",
        "const": "copy"
       },
       "to": {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       },
       "from": {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       }
      },
      "additionalProperties": false
     },
     {
      "type": "object",
      "required": [
       "op",
       "paths"
      ],
      "properties": {
       "op": {
        "type": "string",
        "const": "pick"
       },
       "paths": {
        "type": "array",
        "items": {
         "type": "string",
         "maxLength": 200,
         "minLength": 1
        },
        "maxItems": 40,
        "minItems": 1
       }
      },
      "additionalProperties": false
     },
     {
      "type": "object",
      "required": [
       "op",
       "paths"
      ],
      "properties": {
       "op": {
        "type": "string",
        "const": "omit"
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "side": "response",
  "issues": [],
  "status": "compared",
  "changes": [
   {
    "code": "required_added",
    "path": "/total",
    "after": "total",
    "before": "",
    "detail": "This property is newly required.",
    "effect": "breaking"
   },
   {
    "code": "type_changed",
    "path": "/total",
    "after": "integer",
    "before": "number",
    "detail": "The type allows fewer values.",
    "effect": "breaking"
   }
  ],
  "checkedAt": "2026-11-03T15:00:00.000Z",
  "limitations": [
   "No external API is called and no user-supplied code is executed.",
   "Validation covers type, properties, required, additionalProperties, items, enum, const, length, range, and the formats email, date, and date-time. Other JSON Schema keywords are reported and not applied.",
   "A generated schema uses only values present in the supplied examples. additionalProperties stays true.",
   "A field mapping is proposed only when the path matches or the field name matches one field on each side.",
   "Breaking and non-breaking labels are returned only when side is request or response.",
   "Transforms are rename, copy, pick, omit, cast, and default. A default is written only when the path is absent."
  ],
  "codeExecuted": false,
  "externalCall": false,
  "valuesInvented": false,
  "schemaCompliance": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-contract-compare-509bd55a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
