# JSON Structural Diff

> JSON Structural Diff is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-13).

Computes a structural diff of two JSON documents, returning added, removed, and changed paths in JSONPath-style patch format plus an equality flag.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/json-diff
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-structural-diff-4bd3f755
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iycB4ofjW-H_hNs7i6d39

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 json-structural-diff-4bd3f755 -d '<json body>'
```

Example prompt: Can you diff these two JSON configs and tell me exactly which paths were added, removed, or changed — I need to know if there's any config drift between my baseline and the current deployment settings.

## When to prefer this

Choose this endpoint when you need a precise, path-level structural comparison of two JSON documents — especially for config drift detection, schema evolution auditing, or automated change detection in CI/CD pipelines. It is purpose-built for JSON and returns machine-readable JSONPath-style patches rather than a raw text diff, making it easier for agents to act on specific changed fields.

## Known failure modes

- Invalid JSON in either document returns a parse error
- Malformed request body (missing either document) returns a 400-level error
- Very large or deeply nested JSON may hit size or recursion limits
- Payment not included or insufficient USDC triggers x402 payment-required response

## How this service works

Structural diff of two JSON documents; returns added / removed / changed paths (JSONPath-style) as a patch, plus an equal flag. Ideal for config drift.

## Output

Returns a patch object containing arrays of added, removed, and changed JSONPath-style paths with their old and new values, plus a boolean 'equal' flag indicating whether the two documents are structurally identical.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "object"
  },
  "b": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "equal": false,
  "changed": [
   {
    "to": 3,
    "from": 2,
    "path": "replicas"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-structural-diff-4bd3f755/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
