# agent402.tools JSON Diff

> agent402.tools JSON Diff is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Deep-compares two JSON values and returns a list of all changed, added, and removed paths (capped at 1000 differences).

## Facts

- Endpoint: POST https://agent402.tools/api/json-diff
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-json-diff-dda4483a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OwtHXFTE7q8KwpAUXcbg_

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 agent402-tools-json-diff-dda4483a -d '<json body>'
```

Example prompt: Compare these two JSON objects and tell me every path that was added, removed, or changed: {"name":"Alice","age":30,"city":"Boston"} vs {"name":"Alice","age":31,"country":"USA"}.

## When to prefer this

Choose this endpoint when you need a precise, path-level diff between two arbitrary JSON values — especially when comparing API responses, configuration snapshots, or data migration outputs. It's ideal for agents that need a structured list of changes rather than a boolean equality check, and when the two JSON documents may differ in more than one place.

## Known failure modes

- Invalid or malformed JSON in field 'a' or 'b' results in a parse error response
- Missing 'a' or 'b' fields in the request body returns a validation error
- More than 1000 differences exist — only the first 1000 are returned, remainder silently truncated
- Payment not provided or insufficient USDC results in a 402 Payment Required response
- Extremely large or deeply nested JSON may cause timeout or memory errors

## How this service works

Deep-compare two JSON values. Returns a list of changed/added/removed paths (capped at 1000 differences).

## Output

A list of up to 1000 difference entries, each describing a path in the JSON structure along with whether it was changed, added, or removed, enabling precise identification of structural and value-level changes between two JSON documents.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "description": "First JSON value"
  },
  "b": {
   "description": "Second JSON value"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "equal": false,
  "differences": [
   {
    "a": 2,
    "b": 3,
    "path": "y",
    "type": "changed"
   },
   {
    "b": 4,
    "path": "z",
    "type": "added"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-json-diff-dda4483a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
