# 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-15).

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

## Facts

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

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-2177b596 -d '<json body>'
```

Example prompt: Compare these two JSON configs and tell me exactly which fields were added, removed, or changed — and whether they're equal overall.

## When to prefer this

Choose this endpoint when you need a structured, machine-readable diff of two JSON documents with JSONPath-style paths — especially for config drift detection, API response regression testing, or automated auditing pipelines. Prefer it over text-based diff tools when the semantic structure of JSON (keys, nesting) matters more than line-by-line text changes.

## Known failure modes

- Invalid JSON input returns a parse error
- Malformed request body results in a 400 error
- Extremely large JSON documents may cause timeout or size limit errors
- Missing either document in the request body returns a validation error

## 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 listing all added, removed, and changed paths in JSONPath-style notation, along with an 'equal' boolean 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-2177b596/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)
