# Swift Bot Labs Toolbox – JSON Diff

> Swift Bot Labs Toolbox – JSON Diff is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Computes a JSON diff (RFC 6902-style patch operations) between two JSON values, returning the list of add/replace/remove operations and whether the values are equal.

## Facts

- Endpoint: POST https://x402-toolbox.swiftbotlab.workers.dev/v1/json/diff?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-toolbox-json-diff-4dba2007
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Eydcj0WvDY6F-9wuPIZGF

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 swift-bot-labs-toolbox-json-diff-4dba2007 -d '<json body>'
```

Example prompt: Compare these two JSON objects and tell me exactly what changed — the original is {"v":1,"tags":["a"]} and the updated version is {"v":2,"tags":["a","b"]}.

## When to prefer this

Choose this endpoint when you need a structured, machine-readable diff of two JSON values — especially when you want RFC 6902-style patch operations (add/replace/remove with explicit paths) rather than a visual or textual diff. It is ideal for agents that need to programmatically process change sets, audit configuration drift, or validate that a transformation produced the expected output. Being pay-per-call with no account setup, it suits ephemeral agent workflows where spinning up a dedicated diff service is overkill.

## Known failure modes

- Invalid JSON input in 'a' or 'b' fields returns an error response
- Missing required fields 'a' or 'b' causes a 400-level error
- Payment not provided or insufficient USDC causes an HTTP 402 response requiring x402 payment
- Very large JSON payloads may hit Cloudflare Workers size limits
- Malformed JSON strings passed as the 'a' or 'b' values (when string-encoded) may fail parsing

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

Returns a JSON object with an 'ok' boolean, the tool name 'json-diff', and a 'result' object containing: 'count' (number of diff operations), 'equal' (boolean indicating whether the two inputs are identical), and 'operations' (array of JSON Patch-style objects each with 'op', 'path', and optionally 'value' and 'old' fields).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "description": "Original (a JSON value, or a string containing JSON)"
  },
  "b": {
   "description": "Changed (a JSON value, or a string containing JSON)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "json-diff",
  "result": {
   "count": 2,
   "equal": false,
   "operations": [
    {
     "op": "add",
     "path": "/tags/1",
     "value": "b"
    },
    {
     "op": "replace",
     "old": 1,
     "path": "/v",
     "value": 2
    }
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-toolbox-json-diff-4dba2007/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
